httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@liege.ICS.UCI.EDU>
Subject Re: updated Agenda for 1.2b7
Date Fri, 07 Feb 1997 18:58:50 GMT
>>   * CGI outputting Location: redirect not working
>>     This is an update to a previously submitted
>>     bug report (see below). What seems to be
>>     happening is that when the CGI returns a
>>     redirect (via Location:), the new CGI gets
>>     executed with the old "Content-Length" header
>>     from the original POST CGI. But the content
>>     has all already been read. I'm not an HTTP
>>     expert but it seems like the second CGI should
>>     not "inherit" the Content-Length header from
>>     the first CGI. [archie@whistle.com]  
>> 
>>     Roy says "The problem is that the internal redirect is inheriting
>>     the request state, which it should not be doing.  The solution
>>     is to replace the hack in mod_cgi with a clean request without
>>     the old Content-Length/Transfer-Encoding fields of the original."
> 
> This appears to work fine:
> 
> Index: http_protocol.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_protocol.c,v
> retrieving revision 1.12
> diff -u -r1.12 http_protocol.c
> --- http_protocol.c     1997/01/31 22:26:42     1.12
> +++ http_protocol.c     1997/02/07 01:53:58
> @@ -1186,7 +1186,7 @@
>  
>  int should_client_block (request_rec *r)
>  {
> -    if (is_HTTP_ERROR(r->status))
> +    if (is_HTTP_ERROR(r->status) || r->method_number == M_GET)
>         return 0;
>  
>      if (!r->read_chunked && (r->remaining <= 0))
> 
> 
> I fear there will be unexpected side-effects
> if mod_cgi is changed to use a use a new request. A cleanup can
> wait for 2.0 IMO.

-1, for the same reason as before.  Fixing yet another side-effect of
the same problem is just putting a bandaid on a festering wound.  That
if statement is not necessary if Content-Length and Transfer-Encoding
are cleared from the request state after reading the input.

I had a presentation to give this morning, but will fix this tomorrow
if nobody beats me to it.

....Roy

Mime
View raw message