From: Jeff Trawick Date: Wed, 2 May 2001 16:58:21 +0000 (+0000) Subject: Prevent a hang when a cgi handled by mod_cgid tries to read a X-Git-Tag: 2.0.18~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58e376a83c158a7c37e0b6faba9879210eca9b39;p=apache Prevent a hang when a cgi handled by mod_cgid tries to read a request body from its stdin but no reqest body is being written to the cgi. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88975 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 9f5e4eed4e..77d4cab913 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with Apache 2.0.18-dev + + *) Prevent a hang when a cgi handled by mod_cgid tries to read a + request body from its stdin but no reqest body is being written to + the cgi. [Jeff Trawick] + *) mod_log_config: %c connection status incorrectly logged as "-" (non-keepalive) when MaxKeepAliveRequests is set to 0. [Bill Stoddard] diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 4f2b33d4c5..40bb90d010 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -962,8 +962,12 @@ static int cgid_handler(request_rec *r) break; } } - shutdown(sd, 1); /* done writing; force EOF on child's stdin */ } + /* we're done writing, or maybe we didn't write at all; + * force EOF on child's stdin so that the cgi detects end (or + * absence) of data + */ + shutdown(sd, 1); /* Handle script return... */ if (!nph) {