httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject LF and input filtering (was: Re: cvs commit: ...)
Date Tue, 10 Oct 2000 05:57:01 GMT
On Mon, Oct 09, 2000 at 11:46:54PM -0400, Jeff Trawick wrote:
> rbb@covalent.net writes:
> > > 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.
> 
> That code is broken.

Agreed. It is *way* broken. It only looks for an LF in the last character
position of the data received. Feh. That isn't going to work at all.

If somebody happened to be testing with telnet, then this may hold true, and
the server *may* appear to work. But as soon as you get a script or a
program to shove data at the thing, then you get a lot more data. The LF
will be somewhere inside that first block.

Thus, you have LF scanning in http_filter and getline.

Ryan: if you want to buffer data in core_input_filter, then that is one
thing. What the LF stuff is doing in there is beyond me.

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

No. The code looks good, and there is a bug elsewhere. core_input_filter
grabs stuff from the network. It gets passed up the input filter stack. If
they aren't dealing with it properly, then they have a bug.

>...
> I'm trying to understand why is it so important that the code to
> ensure that we have a LF lives in core_input_filter().  It seems that
> we already have enough code that knows what a header line looks like
> (http_filter(), and getline() to a lesser extent).  
> 
> Why not have http_filter() ask for another brigade if it doesn't get
> enough data back?  Otherwise, core_input_filter() is going to have to
> know whether it is in header mode or body mode.

Agreed and agreed.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message