You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2003/06/21 00:53:15 UTC

cvs commit: httpd-2.0/modules/generators mod_cgid.c

trawick     2003/06/20 15:53:15

  Modified:    .        CHANGES
               modules/generators mod_cgid.c
  Log:
  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.
  
  Revision  Changes    Path
  1.1200    +6 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1199
  retrieving revision 1.1200
  diff -u -r1.1199 -r1.1200
  --- CHANGES	7 Jun 2003 19:50:00 -0000	1.1199
  +++ CHANGES	20 Jun 2003 22:53:14 -0000	1.1200
  @@ -2,6 +2,12 @@
   
     [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]
  
  
  
  1.151     +2 -3      httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- mod_cgid.c	31 Mar 2003 06:12:00 -0000	1.150
  +++ mod_cgid.c	20 Jun 2003 22:53:15 -0000	1.151
  @@ -1189,22 +1189,21 @@
           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,