summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2000-12-06 22:11:58 +0100
committerRyan Bloom <rbb@apache.org>2000-12-06 22:11:58 +0100
commit855891feb29942c774c4d9cca9d706f8e455ef31 (patch)
treec44364edf8111cf2d5f21bb83bc1f3758ef80c1c
parentAdd cgi and cgid back into the configuration system. (diff)
downloadapache2-855891feb29942c774c4d9cca9d706f8e455ef31.tar.xz
apache2-855891feb29942c774c4d9cca9d706f8e455ef31.zip
Get the Perchild MPM serving pages again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87238 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--server/mpm/experimental/perchild/perchild.c23
-rw-r--r--server/mpm/perchild/perchild.c23
2 files changed, 30 insertions, 16 deletions
diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c
index 05ff68f192..6dc86fc169 100644
--- a/server/mpm/experimental/perchild/perchild.c
+++ b/server/mpm/experimental/perchild/perchild.c
@@ -61,6 +61,7 @@
#include "ap_config.h"
#include "apr_hash.h"
#include "apr_strings.h"
+#include "apr_pools.h"
#include "apr_portable.h"
#include "apr_file_io.h"
#include "httpd.h"
@@ -128,7 +129,6 @@ typedef struct {
const char *fullsockname; /* socket base name + extension */
int sd; /* The socket descriptor */
int sd2; /* The socket descriptor */
- char *buffer;
} perchild_server_conf;
typedef struct child_info_t child_info_t;
@@ -1349,8 +1349,11 @@ static int pass_request(request_rec *r)
perchild_server_conf *sconf = (perchild_server_conf *)
ap_get_module_config(r->server->module_config,
&mpm_perchild_module);
- char *foo = sconf->buffer;
- int len = strlen(sconf->buffer);
+ char *foo;
+ int len;
+
+ apr_get_userdata((void **)&foo, "PERCHILD_BUFFER", r->connection->pool);
+ len = strlen(foo);
apr_get_os_sock(&sfd, thesock);
@@ -1457,9 +1460,6 @@ static int perchild_post_read(request_rec *r)
static apr_status_t perchild_buffer(ap_filter_t *f, ap_bucket_brigade *b, ap_input_mode_t mode)
{
- perchild_server_conf *sconf = (perchild_server_conf *)
- ap_get_module_config(f->r->server->module_config,
- &mpm_perchild_module);
ap_bucket *e;
apr_status_t rv;
@@ -1467,11 +1467,18 @@ static apr_status_t perchild_buffer(ap_filter_t *f, ap_bucket_brigade *b, ap_inp
return rv;
}
+
AP_BRIGADE_FOREACH(e, b) {
- const char *str;
+ char *buffer = NULL;
+ const char *str;
apr_size_t len;
+
+ apr_get_userdata((void **)&buffer, "PERCHILD_BUFFER", f->c->pool);
+
ap_bucket_read(e, &str, &len, AP_NONBLOCK_READ);
- apr_pstrcat(f->r->pool, sconf->buffer, str);
+ apr_pstrcat(f->c->pool, buffer, str);
+
+ apr_set_userdata(&buffer, "PERCHILD_BUFFER", apr_null_cleanup, f->c->pool);
}
return APR_SUCCESS;
diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c
index 05ff68f192..6dc86fc169 100644
--- a/server/mpm/perchild/perchild.c
+++ b/server/mpm/perchild/perchild.c
@@ -61,6 +61,7 @@
#include "ap_config.h"
#include "apr_hash.h"
#include "apr_strings.h"
+#include "apr_pools.h"
#include "apr_portable.h"
#include "apr_file_io.h"
#include "httpd.h"
@@ -128,7 +129,6 @@ typedef struct {
const char *fullsockname; /* socket base name + extension */
int sd; /* The socket descriptor */
int sd2; /* The socket descriptor */
- char *buffer;
} perchild_server_conf;
typedef struct child_info_t child_info_t;
@@ -1349,8 +1349,11 @@ static int pass_request(request_rec *r)
perchild_server_conf *sconf = (perchild_server_conf *)
ap_get_module_config(r->server->module_config,
&mpm_perchild_module);
- char *foo = sconf->buffer;
- int len = strlen(sconf->buffer);
+ char *foo;
+ int len;
+
+ apr_get_userdata((void **)&foo, "PERCHILD_BUFFER", r->connection->pool);
+ len = strlen(foo);
apr_get_os_sock(&sfd, thesock);
@@ -1457,9 +1460,6 @@ static int perchild_post_read(request_rec *r)
static apr_status_t perchild_buffer(ap_filter_t *f, ap_bucket_brigade *b, ap_input_mode_t mode)
{
- perchild_server_conf *sconf = (perchild_server_conf *)
- ap_get_module_config(f->r->server->module_config,
- &mpm_perchild_module);
ap_bucket *e;
apr_status_t rv;
@@ -1467,11 +1467,18 @@ static apr_status_t perchild_buffer(ap_filter_t *f, ap_bucket_brigade *b, ap_inp
return rv;
}
+
AP_BRIGADE_FOREACH(e, b) {
- const char *str;
+ char *buffer = NULL;
+ const char *str;
apr_size_t len;
+
+ apr_get_userdata((void **)&buffer, "PERCHILD_BUFFER", f->c->pool);
+
ap_bucket_read(e, &str, &len, AP_NONBLOCK_READ);
- apr_pstrcat(f->r->pool, sconf->buffer, str);
+ apr_pstrcat(f->c->pool, buffer, str);
+
+ apr_set_userdata(&buffer, "PERCHILD_BUFFER", apr_null_cleanup, f->c->pool);
}
return APR_SUCCESS;