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_protocol.c
Date Thu, 12 Oct 2000 13:43:01 GMT

> > No, there is no reason to keep c->remaining intact between
> > invocations.  The whole point of c->remaining is to say "grab no more than
> > this much data from the bucket brigade and return it to me."  Once we have
> > returned that much data, the remaining field is invalid.
> 
> But how does this work in the presence of chunking?
> 
> Let's presume that the input-chunking-filter sits above http_filter. To read
> a chunk from the body, it must do a getline(). Then, it must read N bytes of
> data. Then, it will do a getline() again.
> 
> c->remaining does not signal "end of request", but just "end of read".
> Another flag must be used to signal end-of-request (as I stated in my
> commentary email).
> 
> Hmm... also, it sounds like we ought to have a utility function that reads a
> line of text from a brigade. That can be used by the header-reading code,
> and by the chunk-handling code.

No.  chunking works, because the de-chunk filter sits in a loop.  It reads
a line using c->remaining == 0, then it reads a block of data.  Then it
reads a line (c->remaining == 0), then it reads a block of data,
etc.  There is no need to signal end of request.  We are at the end of the
request when the de-chunk filter stops reading, and it sets c->remaining
to zero.

> Hmm. I guess it could also "pass everything it has" on up the chain. No
> reason for it to keep pieces... oh wait. When it hits the end of a request,
> it must hold the remaining data for the next request.
> 
> IOW, yes: http_filter does need the ctx, and it would store a brigade of
> unused input there. (unused because it belongs to the next request, or to
> the next chunk)

http_filter needs a ctx pointer, and it has one right
now.  ap_get_client_block does not ever need one, and it shouldn't have
one.

Ryan

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


Mime
View raw message