Bug 34876 - mod_proxy buffers across chunk boundaries when returning data to the client using chunked encoding
Summary: mod_proxy buffers across chunk boundaries when returning data to the client u...
Status: RESOLVED DUPLICATE of bug 18157
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: HEAD
Hardware: Other All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2005-05-11 22:36 UTC by Jon Perlow
Modified: 2005-05-12 00:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Perlow 2005-05-11 22:36:28 UTC
When using mod_proxy as a reverse proxy, I hit the case where it would buffer
accross chunk boundaries for chunks that are returned to the client. The data
will no be sent until the buffer limit is reached. This breaks certain classes
of web applications that return intermediate results over http over an extended
period of time.

The fix is to apply the following diff to proxy_util.c. This forces each chunk
to be flushed to the socket when the end of the chunk is reached.

--- proxy_util.c.prev   2005-05-11 13:29:13.000000000 -0700
+++ proxy_util.c        2005-05-11 13:30:25.000000000 -0700
@@ -605,6 +605,10 @@
 
             w = ap_bwrite(con->client, &buf[o], n);
 
+            if (chunked) {
+              ap_bflush(con->client);
+            }
+
             if (alternate_timeouts)
                 ap_kill_timeout(r);
             else
Comment 1 Joe Orton 2005-05-12 08:55:30 UTC
This is really a special case of bug 18157.

*** This bug has been marked as a duplicate of 18157 ***