You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2001/04/23 21:40:26 UTC

Re: cvs commit: httpd-2.0/include util_filter.h

rbb@apache.org wrote:

>   + * @param readbytes How many bytes to read from the next filter.  0 means that
>   + *                  a single line should be read.
>     */
>    AP_DECLARE(apr_status_t) ap_get_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket,
>                                            ap_input_mode_t mode, apr_size_t *readbytes);

Just to clarify - does this mean that ap_get_brigade() with a readbytes
of zero will always return a single line (CRLF terminated), without the
need to call it repeatedly until a complete line is returned?

Is there a guaranteed minumim length that will be returned? ie is it
reasonable to assume that if ap_get_brigade() was called once, and you
were expecting a status line or a header line, you would get the whole
line unless the line is ridiculously long? If so I can simplify the
proxy code.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: cvs commit: httpd-2.0/include util_filter.h

Posted by rb...@covalent.net.
On Mon, 23 Apr 2001, Graham Leggett wrote:

> rbb@apache.org wrote:
>
> >   + * @param readbytes How many bytes to read from the next filter.  0 means that
> >   + *                  a single line should be read.
> >     */
> >    AP_DECLARE(apr_status_t) ap_get_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket,
> >                                            ap_input_mode_t mode, apr_size_t *readbytes);
>
> Just to clarify - does this mean that ap_get_brigade() with a readbytes
> of zero will always return a single line (CRLF terminated), without the
> need to call it repeatedly until a complete line is returned?

It works the exact same way that it used to work, except that instead of
filling out c->remain, you pass the value down the stack.

> Is there a guaranteed minumim length that will be returned? ie is it
> reasonable to assume that if ap_get_brigade() was called once, and you
> were expecting a status line or a header line, you would get the whole
> line unless the line is ridiculously long? If so I can simplify the
> proxy code.

There are no garauntees about how much data is actually returned.  It is
also not possible to make any garauntees about this.  What happens if the
client doesn't send a full line of data.  We still have to return what we
got.

Ryan


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