httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Ames <grega...@remulak.net>
Subject [PATCH] subrequests don't inherit bodies
Date Mon, 14 Mar 2005 21:47:44 GMT
A customer reported a problem where their back end app would hang until a read 
timed out.  The main request was a POST which did have a request body which was 
read normally.  The POST response contained an ssi tag that caused a subrequest 
to be created.  The subrequest was forwarded to an app on a back end server. 
This forwarded subrequest contained a Content-Length header so the back end 
server/app was expecting a request body that didn't exist, thus the read timeout.

As it turns out, we clone all of the main request's input headers when we create 
the subrequest, including C-L.  Whacking the subrequest's C-L header fixes the 
hang.  Since the main request's body could also have be chunked, we should 
probably remove the subrequest's Transfer-Encoding header as well.

There could be other headers that don't make sense for subrequests without 
bodies, such as gzip/deflate headers.  But I'm concerned about adding too much 
to a fairly common code path.  a few thoughts for changes to subrequest creation:

1. do a quick test for the main request containing a body.  if true (pretty rare 
case), remove all headers pertaining to request bodies.

2. generate a minimal set of headers from scratch that make sense for the 
subrequest, rather than cloning them from the main request

3. (attached) just remove the headers that say a request body exists.

Thoughts?

Greg

Mime
View raw message