You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/09/12 05:40:16 UTC
cvs commit: apache-2.0/src/main http_protocol.c util_filter.c
rbb 00/09/11 20:40:16
Modified: src CHANGES
src/include httpd.h
src/main http_protocol.c util_filter.c
Log:
Ensure that only one EOS bucket is sent down the filter stack. This is
done by adding a flag to the request_rec. When ap_pass_bucket sees an
EOS bucket, the flag is set. If the flag is still unset when
ap_finalize_request is called, then ap_finalize_request sends an EOS. This
fixes the problem with chunking and CGI.
Revision Changes Path
1.221 +8 -0 apache-2.0/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-2.0/src/CHANGES,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -r1.220 -r1.221
--- CHANGES 2000/09/11 18:27:54 1.220
+++ CHANGES 2000/09/12 03:40:14 1.221
@@ -1,4 +1,12 @@
Changes with Apache 2.0a7
+ *) Fix chunking problem with CGI scripts. The general problem was that
+ the CGI modules were adding an EOS bucket and then the core added an
+ EOS bucket. The chunking filter finalizes the chunked response when it
+ encounters an EOS bucket. Because two EOS buckets were sent, we
+ finalized the response twice. The fix is to make sure we only send one
+ EOS, by utilizing a flag in the request_rec.
+ [Ryan Bloom]
+
*) apr_put_os_file() now sets up the unget byte appropriately on Unix
and Win32. Previously, the first read from an apr_file_t set up via
apr_put_os_file() would return a '\0'. [Jeff Trawick]
1.84 +1 -0 apache-2.0/src/include/httpd.h
Index: httpd.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- httpd.h 2000/09/01 14:47:20 1.83
+++ httpd.h 2000/09/12 03:40:15 1.84
@@ -800,6 +800,7 @@
/** A list of filters to be used for this request
* @defvar ap_filter_t *filters */
struct ap_filter_t *filters;
+ int eos_sent;
/* Things placed at the end of the record to avoid breaking binary
* compatibility. It would be nice to remember to reorder the entire
1.121 +3 -1 apache-2.0/src/main/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- http_protocol.c 2000/09/09 06:48:09 1.120
+++ http_protocol.c 2000/09/12 03:40:15 1.121
@@ -1921,7 +1921,9 @@
API_EXPORT(void) ap_finalize_request_protocol(request_rec *r)
{
/* tell the filter chain there is no more content coming */
- end_output_stream(r);
+ if (!r->eos_sent) {
+ end_output_stream(r);
+ }
}
/* Here we deal with getting the request message body from the client.
1.15 +3 -0 apache-2.0/src/main/util_filter.c
Index: util_filter.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/util_filter.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- util_filter.c 2000/09/09 06:48:09 1.14
+++ util_filter.c 2000/09/12 03:40:15 1.15
@@ -155,6 +155,9 @@
API_EXPORT(apr_status_t) ap_pass_brigade(ap_filter_t *next, ap_bucket_brigade *bb)
{
if (next) {
+ if (AP_BRIGADE_LAST(bb)->type == AP_BUCKET_EOS) {
+ next->r->eos_sent = 1;
+ }
return next->filter_func(next, bb);
}
return AP_NOBODY_WROTE;