Commit e56dc237 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

Fix a storage leak in mod_cgid... the temporary pool created for

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
parent 283718e0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
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
+5 −1
Original line number Diff line number Diff line
@@ -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; 
}