Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 50690 invoked from network); 30 Dec 2004 16:31:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 30 Dec 2004 16:31:34 -0000 Received: (qmail 8525 invoked by uid 500); 30 Dec 2004 16:31:18 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 8464 invoked by uid 500); 30 Dec 2004 16:31:17 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 8437 invoked by uid 99); 30 Dec 2004 16:31:17 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 30 Dec 2004 08:31:16 -0800 Received: (qmail 50526 invoked by uid 65534); 30 Dec 2004 16:31:14 -0000 Date: 30 Dec 2004 16:31:14 -0000 Message-ID: <20041230163114.50524.qmail@minotaur.apache.org> From: trawick@apache.org To: cvs@httpd.apache.org Subject: svn commit: r123727 - /httpd/httpd/trunk/CHANGES /httpd/httpd/trunk/modules/proxy/proxy_http.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 /* */ 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); }