]> granicus.if.org Git - apache/commitdiff
Fix a storage leak in mod_cgid... the temporary pool created for
authorJeff Trawick <trawick@apache.org>
Thu, 29 Mar 2001 00:17:50 +0000 (00:17 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 29 Mar 2001 00:17:50 +0000 (00:17 +0000)
each request was not cleaned up.

This removes the nastiest symptom of some excess pipes being created
(i.e., we don't run out of file descriptors), though something
additional is needed to keep from creating the pipes to begin with.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88611 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/generators/mod_cgid.c

diff --git a/CHANGES b/CHANGES
index 548a94b70a756122a45a2e0c8d55c0fafca1309a..83a68381ca02517baf7d15fdab71ec3dc208c4f4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
 Changes with Apache 2.0.16-dev
+
+  *) Clean up mod_cgid's temporary request pool.  Besides fixing a
+     storage leak this ensures that some unnecessary pipes are closed.
+     [Jeff Trawick]
+
   *) Performance: Add quick_handler hook. This hook is called at the
      very beginning of the request processing before location_walk,
      translate_name, etc.  This hook is useful for URI keyed content
index 56a7acccff4b7214adeae114dbf5188c3e697825..967d7979f45afdb4576f2fc3de7793a838236487 100644 (file)
@@ -505,7 +505,6 @@ static int cgid_server(void *data)
         apr_proc_t *procnew = NULL;
         apr_file_t *inout;
 
-
         len = sizeof(unix_addr);
         sd2 = accept(sd, (struct sockaddr *)&unix_addr, &len);
         if (sd2 < 0) {
@@ -539,6 +538,10 @@ static int cgid_server(void *data)
                                         in_pipe,
                                         out_pipe,
                                         err_pipe)) != APR_SUCCESS) ||
+              /* XXX apr_procattr_child_*_set() is creating an unnecessary 
+               * pipe between this process and the child being created...
+               * It is cleaned up with the temporary pool for this request.
+               */
               ((rc = apr_procattr_child_err_set(procattr, r->server->error_log, NULL)) != APR_SUCCESS) ||
               ((rc = apr_procattr_child_in_set(procattr, inout, NULL)) != APR_SUCCESS))) ||
             ((rc = apr_procattr_child_out_set(procattr, inout, NULL)) != APR_SUCCESS) ||
@@ -571,6 +574,7 @@ static int cgid_server(void *data)
                         "couldn't create child process: %d: %s", rc, r->filename);
             }
         }
+        apr_pool_clear(p);
     } 
     return -1; 
 }