httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject CGI -> ErrorDocument bug with POSTed data
Date Sat, 11 Jan 1997 23:52:47 GMT

A bug reporter finally convinced me there was a bug here and I tracked it down
to the following...

A POST request to a CGI script that fails can be redirected to another
CGI to handle via ErrorDocument 500.

Apache uses:
	     if (!r->read_chunked && (r->remaining <= 0))

to decide if it should read the POSTed data, but the 2nd script can't
find any POSTed data so it'll hang. If the script doesn't look for POSTed
data Apache does, so it hangs.

A fix is as follows,


Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.8
diff -u -r1.8 http_protocol.c
--- http_protocol.c     1997/01/11 16:23:27     1.8
+++ http_protocol.c     1997/01/11 23:37:22
@@ -1159,6 +1159,9 @@
 
 int should_client_block (request_rec *r)
 {
+    if (is_HTTP_ERROR(r->status))
+       return 0;
+
     if (!r->read_chunked && (r->remaining <= 0))
         return 0;




Mime
View raw message