httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r123727 - /httpd/httpd/trunk/CHANGES /httpd/httpd/trunk/modules/proxy/proxy_http.c
Date Thu, 30 Dec 2004 16:31:14 GMT
Author: trawick
Date: Thu Dec 30 08:31:13 2004
New Revision: 123727

URL: http://svn.apache.org/viewcvs?view=rev&rev=123727
Log:
mod_proxy: Fix a request corruption problem and a buffering problem
which sometimes prevented proxy-sendchunks from working.

strlen() couldn't be used since no space had been allocated
for trailing NUL, so occasionally the T-E header field contained
garbage and a 400 error would be returned by the origin server.

The lack of a flush bucket after the final "0\r\n\r\n" was a
showstopper for my simple tests (reverse proxy to Apache 1.3 +
custom module which read the body).

Modified:
   httpd/httpd/trunk/CHANGES
   httpd/httpd/trunk/modules/proxy/proxy_http.c

Modified: httpd/httpd/trunk/CHANGES
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?view=diff&rev=123727&p1=httpd/httpd/trunk/CHANGES&r1=123726&p2=httpd/httpd/trunk/CHANGES&r2=123727
==============================================================================
--- httpd/httpd/trunk/CHANGES	(original)
+++ httpd/httpd/trunk/CHANGES	Thu Dec 30 08:31:13 2004
@@ -2,6 +2,10 @@
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) mod_proxy: Fix a request corruption problem and a buffering problem
+     which sometimes prevented proxy-sendchunks from working.
+     [Jeff Trawick]
+
   *) Fix the RPM spec file so that an RPM build now works. An RPM
      build now requires system installations of APR and APR-util.
      [Graham Leggett]

Modified: httpd/httpd/trunk/modules/proxy/proxy_http.c
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/proxy/proxy_http.c?view=diff&rev=123727&p1=httpd/httpd/trunk/modules/proxy/proxy_http.c&r1=123726&p2=httpd/httpd/trunk/modules/proxy/proxy_http.c&r2=123727
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_http.c	(original)
+++ httpd/httpd/trunk/modules/proxy/proxy_http.c	Thu Dec 30 08:31:13 2004
@@ -467,7 +467,7 @@
         buf = apr_pmemdup(p, te_hdr, sizeof(te_hdr)-1);
         ap_xlate_proto_to_ascii(buf, sizeof(te_hdr)-1);
 
-        e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
+        e = apr_bucket_pool_create(buf, sizeof(te_hdr)-1, p, c->bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(header_brigade, e);
     }
     else {
@@ -586,6 +586,8 @@
         e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
                                        /* <trailers> */
                                        ASCII_CRLF, 5, c->bucket_alloc);
+        APR_BRIGADE_INSERT_TAIL(body_brigade, e);
+        e = apr_bucket_flush_create(c->bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(body_brigade, e);
     }
 

Mime
View raw message