]> granicus.if.org Git - apache/commitdiff
mod_cgid: Eliminate a double-close of a socket. This resolves
authorJeff Trawick <trawick@apache.org>
Fri, 20 Jun 2003 22:53:15 +0000 (22:53 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 20 Jun 2003 22:53:15 +0000 (22:53 +0000)
various operational problems in a threaded MPM, since on the
second attempt to close the socket, the same descriptor was
often already in use by another thread for another purpose.

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

CHANGES
modules/generators/mod_cgid.c

diff --git a/CHANGES b/CHANGES
index e2509e32fd1bdfb042e7d3a9f535a03075f8e5b0..66f8234d2545a175a1b2e8436abf0da4d012a35d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,12 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) mod_cgid: Eliminate a double-close of a socket.  This resolves
+     various operational problems in a threaded MPM, since on the
+     second attempt to close the socket, the same descriptor was
+     often already in use by another thread for another purpose.
+     [Jeff Trawick]
+
   *) Unix: Handle permissions settings for flock-based mutexes in 
      unixd_set_global|proc_mutex_perms().  Allow the functions to be
      called for any type of mutex.  PR 20312  [Jeff Trawick]
index 34be91ee7bf7d721c92430389eedeb5639c95ab3..44845ff51afa9e339de04e545c6e609c3a0258b8 100644 (file)
@@ -1189,22 +1189,21 @@ static apr_status_t cleanup_script(void *vptr)
         return APR_EGENERAL;
     }
 
+    /* we got a socket, and there is already a cleanup registered for it */
+
     req.req_type = GETPID_REQ;
     req.conn_id = info->r->connection->id;
 
     stat = sock_write(sd, &req, sizeof(req));
     if (stat != APR_SUCCESS) {
-        close(sd);
         return stat;
     }
 
     /* wait for pid of script */
     stat = sock_read(sd, &pid, sizeof(pid));
     if (stat != APR_SUCCESS) {
-        close(sd);
         return stat;
     }
-    close(sd);
 
     if (pid == 0) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, info->r,