]> granicus.if.org Git - apache/commitdiff
Prevent a hang when a cgi handled by mod_cgid tries to read a
authorJeff Trawick <trawick@apache.org>
Wed, 2 May 2001 16:58:21 +0000 (16:58 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 2 May 2001 16:58:21 +0000 (16:58 +0000)
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

CHANGES
modules/generators/mod_cgid.c

diff --git a/CHANGES b/CHANGES
index 9f5e4eed4e3ebd109f04230a88b7d77c30ab75cd..77d4cab9130d32842e1301e336dd5302bd397ec4 100644 (file)
--- 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]
index 4f2b33d4c547c3a3a3b4e0fa4547e2c85d3325fd..40bb90d010c71ef655dad69da547415f502edc80 100644 (file)
@@ -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) {