httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: [PATCH] Take 2 of the http filter rewrite
Date Mon, 24 Sep 2001 19:14:22 GMT
On Mon, 24 Sep 2001, Justin Erenkrantz wrote:

> The brigades should not be returning more data than is asked for
> ever.

Right.  But the only increment the API allows to ask for are one whole
bucket's worth at a time.

> What happens then is that we now enter a condition where the
> caller may not be able to handle the data (i.e. I only wanted 10
> bytes you gave me 8192, oops).

The filters should be able to handle this.  Like I said before, if you
want 10 bytes, fine... just do this:

if (apr_bucket_split(b, 10) == APR_ENOTIMPL) {
    /* bucket cannot be split natively */
    apr_bucket_read(b,str,&len,APR_BLOCK_READ); /* check for errors */
    apr_bucket_split(b, 10);                    /* check for errors */
}
apr_bucket_read(b,str,&len,block);              /* check for errors */

I guarantee you len will come back as 10 every time, because b is now 10
bytes and b->next is all the rest.

[I still wish we allowed pipe and socket buckets to be split natively.  I
 know Ryan has strongly opposed that idea in the past, but I still think
 it should be possible.]

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message