httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: cvs commit: apache-2.0/src/main http_core.c
Date Tue, 10 Oct 2000 03:22:26 GMT
On 9 Oct 2000, Jeff Trawick wrote:

> rbb@covalent.net writes:
> 
> > -1  That is wrong.  The code to look for LF is 100% correct.  The part
> > that was the ugly hack was the duplicated ASCII_LF macro.
> 
> No way...  
> 
> Look at this code...
> 
>     rv = apr_recv(csock, buff, &length);
> 
>  suppose we just read 100 bytes of header and 8092 bytes of
>  posted data into our 8192-byte buffer
> 
>  rv is APR_SUCCESS, length is 8192
> 
>     if (rv == APR_SUCCESS) {
>         if (length > 0) {
>             templen = length - 1;
> 
>  the next line looks for LF in the posted data, which is
>  bogosity
> 
>             while (buff[templen] != ASCII_LF) {
> 
>  the next line tells apr_recv to read up to 8192 bytes into the
>  storage beyond our buffer; more bogosity
> 
>                 rv = apr_recv(csock, buff + templen + 1, &length);
>                 templen += length;
>             }
>                  
> 
> If this code is really supposed to look for LF, what the heck is the
> code in http_filter() for?  That code seems perfectly capable of
> finding the end of a header line.  In addition, it even knows when it
> is valid to think in terms of header lines (excusing the possibility
> of chunked encoding for the moment).

But, it can't buffer data.  The whole point of this section of code, is to
buffer for those apps that send a char at a time.

> 
> core_input_filter() doesn't know the difference between header and
> body.  As such, it can't look for LF.

Without this change, telnet apps that send a char at a time won't
work.  It's that simple.  Since this is basically the exact same design
that 1.3's BUFF code used, I think we are safe.

The removal is bogus.  It breaks Windows and BeOS, and it MUST be
reversed.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message