From: Jeff Trawick Date: Mon, 23 Jun 2003 12:28:25 +0000 (+0000) Subject: merge this from 2.0.47: X-Git-Tag: 2.0.47~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13274edb9c1b30dff263ba102f201115799ddec2;p=thirdparty%2Fapache%2Fhttpd.git merge this from 2.0.47: * 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. reviewed by: brianp, stoddard git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@100337 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a41feca631b..29dd4d2a36b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with Apache 2.0.47 + *) 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] + *) mod_negotiation: Introduce "prefer-language" environment variable, which allows to influence the negotiation process on request basis to prefer a certain language. [André Malo] diff --git a/STATUS b/STATUS index c62eb8cf8ac..229e189aa58 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2003/06/23 11:16:10 $] +Last modified at [$Date: 2003/06/23 12:28:24 $] Release: @@ -248,13 +248,6 @@ PATCHES TO PORT FROM 2.1 os/unix/unixd.h 1.138 +1: trawick - * 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. - modules/generators/mod_cgid.c 1.151 - +1: trawick, brianp, stoddard - CURRENT RELEASE NOTES: * Backwards compatibility is expected of future Apache 2.0 releases, diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 34be91ee7bf..44845ff51af 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -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,