From: Ryan Bloom Date: Tue, 19 Dec 2000 01:59:54 +0000 (+0000) Subject: Get the perchild MPM working better again. I have been able to pass X-Git-Tag: APACHE_2_0_BETA_CANDIDATE_1~408 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=337464ae2fdec9aab2ddc81e9eb6790d083bb55a;p=apache Get the perchild MPM working better again. I have been able to pass some file descriptors back and forth and serve requests, but this code is still very experimental. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87415 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 2d01f22949..98674cd88b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2000/12/17 03:08:43 $] +Last modified at [$Date: 2000/12/19 01:59:53 $] Release: @@ -17,12 +17,6 @@ Release: RELEASE SHOWSTOPPERS: - * Perchild MPM doesn't build anymore. This is still relying on the - BUFF code, which is no longer there. This should just be modified - to do the passing in an input filter instead of relying on the - post_read_request phase. - Status: Ryan Volunteers - * Root all file systems with for WIN32/OS2/NW permissions Status: patch brought forward from 1.3.14 WIN32 and OS2 need review [William Rowe, Brian Harvard] diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c index 72ea97fe57..286430e59c 100644 --- a/server/mpm/experimental/perchild/perchild.c +++ b/server/mpm/experimental/perchild/perchild.c @@ -1356,10 +1356,13 @@ static int pass_request(request_rec *r) apr_get_userdata((void **)&foo, "PERCHILD_BUFFER", r->connection->pool); len = strlen(foo); + apr_set_userdata(NULL, "PERCHILD_BUFFER", apr_null_cleanup, + r->connection->pool); + apr_get_os_sock(&sfd, thesock); - iov.iov_base = (char *)sconf->fullsockname; - iov.iov_len = strlen(sconf->fullsockname) + 1; + iov.iov_base = NULL; + iov.iov_len = 0; msg.msg_name = NULL; msg.msg_namelen = 0; @@ -1384,7 +1387,7 @@ static int pass_request(request_rec *r) write(sconf->sd2, foo, len); - while (ap_get_brigade(r->input_filters, bb, AP_MODE_NONBLOCKING) != APR_SUCCESS) { + while (ap_get_brigade(r->input_filters, bb, AP_MODE_NONBLOCKING) == APR_SUCCESS) { ap_bucket *e; AP_BRIGADE_FOREACH(e, bb) { const char *str; @@ -1497,10 +1500,11 @@ static apr_status_t perchild_buffer(ap_filter_t *f, ap_bucket_brigade *b, ap_inp ap_bucket_read(e, &str, &len, AP_NONBLOCK_READ); if (buffer == NULL) { - buffer = apr_pstrdup(f->c->pool, str); + buffer = apr_pstrndup(f->c->pool, str, len); } else { - buffer = apr_pstrcat(f->c->pool, buffer, str, NULL); + buffer = apr_pstrcat(f->c->pool, buffer, + apr_pstrndup(f->c->pool, str, len), NULL); } } } diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c index 72ea97fe57..286430e59c 100644 --- a/server/mpm/perchild/perchild.c +++ b/server/mpm/perchild/perchild.c @@ -1356,10 +1356,13 @@ static int pass_request(request_rec *r) apr_get_userdata((void **)&foo, "PERCHILD_BUFFER", r->connection->pool); len = strlen(foo); + apr_set_userdata(NULL, "PERCHILD_BUFFER", apr_null_cleanup, + r->connection->pool); + apr_get_os_sock(&sfd, thesock); - iov.iov_base = (char *)sconf->fullsockname; - iov.iov_len = strlen(sconf->fullsockname) + 1; + iov.iov_base = NULL; + iov.iov_len = 0; msg.msg_name = NULL; msg.msg_namelen = 0; @@ -1384,7 +1387,7 @@ static int pass_request(request_rec *r) write(sconf->sd2, foo, len); - while (ap_get_brigade(r->input_filters, bb, AP_MODE_NONBLOCKING) != APR_SUCCESS) { + while (ap_get_brigade(r->input_filters, bb, AP_MODE_NONBLOCKING) == APR_SUCCESS) { ap_bucket *e; AP_BRIGADE_FOREACH(e, bb) { const char *str; @@ -1497,10 +1500,11 @@ static apr_status_t perchild_buffer(ap_filter_t *f, ap_bucket_brigade *b, ap_inp ap_bucket_read(e, &str, &len, AP_NONBLOCK_READ); if (buffer == NULL) { - buffer = apr_pstrdup(f->c->pool, str); + buffer = apr_pstrndup(f->c->pool, str, len); } else { - buffer = apr_pstrcat(f->c->pool, buffer, str, NULL); + buffer = apr_pstrcat(f->c->pool, buffer, + apr_pstrndup(f->c->pool, str, len), NULL); } } }