Bug 37514 - mod_proxy buffers chunked data.
Summary: mod_proxy buffers chunked data.
Status: RESOLVED LATER
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.0.55
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: MassUpdate
Depends on:
Blocks:
 
Reported: 2005-11-15 21:50 UTC by inder sabharwal
Modified: 2018-11-07 21:09 UTC (History)
0 users



Attachments
Proposed patch for Apache 2.0.59 (538 bytes, patch)
2007-06-27 05:40 UTC, Philippe Dutrueux
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description inder sabharwal 2005-11-15 21:50:31 UTC
I have a server that sends data using Transfer-Encoding: Chunked, but mod_proxy 
is buffering up the data until it hits the internal limit of 8K.  Our client 
application expects to receive data from the server over a period of time, and 
doesnot know the length of the data in advance.

I have looked at bugs 19954 and 34876, which claim to have fixed this in the 
latest version of apache, but apparently it is not so. I have tried it on the 
following apache servers:
1.) Server version: Apache/2.0.46
Server built:   Nov  5 2004 10:58:21

2.) Server version: Apache/2.0.55
Server built:   Nov 15 2005 00:06:22

3.) The 2.1 beta available from apache.org.

I am running RH linux AS3 U4:
Linux .... 2.4.21-27.EL #1 Wed Dec 1 22:08:15 EST 2004 i686 i686 i386 GNU/Linux

Is there a patch available somewhere that I could use or a configuration item 
that I may be missing out?
Comment 1 inder sabharwal 2005-11-16 02:06:51 UTC
I made the following changes to make mod_proxy work:
1006,1007d1005
<             int chunked = 0;
<             char* c1=0;
1009,1014d1006
<             c1 = apr_table_get(r->headers_out, "Transfer-Encoding");
<             if (c1) {
<                 ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, r->server, "->>
encoding is: %s", c1);
<                 if (!strcmp(c1, "chunked"))
<                    chunked=1;
<             }
1046,1047c1038,1039
<                     if ( APR_STATUS_IS_EAGAIN(rv)
<                         || (rv == APR_SUCCESS && APR_BRIGADE_EMPTY(bb)) ) {
---
>                     if (APR_STATUS_IS_EAGAIN(rv)
>                         || (rv == APR_SUCCESS && APR_BRIGADE_EMPTY(bb))) {
1051,1052c1043
<                         if (ap_pass_brigade(r->output_filters, bb)
<                             || c->aborted) {
---
>                         if (ap_pass_brigade(r->output_filters, bb)) {
1065,1077d1055
 If chunked response, then flush right away.
< 
<                     if (!APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb)) && chunked) {
<                         e = apr_bucket_flush_create(c->bucket_alloc);
<                         APR_BRIGADE_INSERT_TAIL(bb, e);
<                         if (ap_pass_brigade(r->output_filters, bb)
<                             || c->aborted) {
<                             backend->close = 1;
<                             break;
<                         }
<                         apr_brigade_cleanup(bb);
<                         continue;
<                   }
< 

Streaming data works just fine, but apache LEAKS MEMORY - I believe apache is 
holding onto the stream unless either the browser is closed  or the server
closes the connection.

Is there something obviously wrong that I am doing here, or is this an apache issue?

-Thanks.
-Inder.
Comment 2 Ruediger Pluem 2005-11-16 22:07:29 UTC
Your patch is currently a little hard to review. I guess it is against 2.1.x.
Can you please

1. Provide the exact version of 2.1 where you faced the problem .
2. Provide the exact version where this patch is against.
3. Provide the patch as unified diff (see
http://httpd.apache.org/dev/patches.html) as an attachment.
Comment 3 Philippe Dutrueux 2007-06-27 05:40:05 UTC
Created attachment 20401 [details]
Proposed patch for Apache 2.0.59

This patch inserts a flush bucket after each block of chunk data received from
the web server. It will force a chunk block to be generated to the client
connection.
Feedback welcome.
Comment 4 William A. Rowe Jr. 2018-11-07 21:09:22 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.