httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <>
Subject [PATCH] Fix proxy's handling of input bodies
Date Tue, 03 Dec 2002 08:52:41 GMT
Currently, mod_proxy falls down if a filter is in the input chain
that changes the content of the original request.  It will send the
original Content-Length not the size of the data it actually sends.
If the request was originally chunked, but the data it actually sends
isn't chunked (it sends no C-L header in this case).  Oops.

This patch changes it so that mod_proxy delays setting the
Content-Length header until we have read the entire body from the
filters and can recompute the C-L header.  This is kind of icky, but
there is no way around that if we're sending the C-L header.

What we can do is either do non-keepalive connections or send T-E:
chunked requests.  In both of those cases, we don't have to stick
around and wait for the entire body to be read - we can send as data
is ready.  Of course, most HTTP servers don't allow for T-E: chunked
requests (that's only in late 2.0 httpd - 1.3 will return 413 or
something like that - unknown about other vendors).  So, the default
is to buffer the entire thing since that's the only thing that has a
shot of working in the real world.  There's a note that can be set
that will send chunks if we think the other end will support it.

Anyway, this passes httpd-test and works for me, but before actually
committing this, I'd like to give a heads-up first to see if anyone
will complain.  -- justin
View raw message