]> granicus.if.org Git - apache/commitdiff
Get the perchild MPM working better again. I have been able to pass
authorRyan Bloom <rbb@apache.org>
Tue, 19 Dec 2000 01:59:54 +0000 (01:59 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 19 Dec 2000 01:59:54 +0000 (01:59 +0000)
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

STATUS
server/mpm/experimental/perchild/perchild.c
server/mpm/perchild/perchild.c

diff --git a/STATUS b/STATUS
index 2d01f229490b9d2ea3f25ea9b637596f1d61279d..98674cd88b11d381d8fb13d2b363b1a25d65d048 100644 (file)
--- 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 <Directory /> for WIN32/OS2/NW permissions 
         Status: patch brought forward from 1.3.14
                 WIN32 and OS2 need review [William Rowe, Brian Harvard]
index 72ea97fe576f33494b84cf710aba48c52cc343c7..286430e59c74c99acafa7f29b0f7828b443c1f32 100644 (file)
@@ -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);
             } 
         }
     }
index 72ea97fe576f33494b84cf710aba48c52cc343c7..286430e59c74c99acafa7f29b0f7828b443c1f32 100644 (file)
@@ -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);
             } 
         }
     }