httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject Re: cvs commit: httpd-2.0/server/mpm/perchild perchild.c
Date Wed, 09 May 2001 02:00:29 GMT
On Tue, May 08, 2001 at 02:48:17PM +0100, Ben Laurie wrote:
> This is exactly what I was trying to get at... it seems we end up with a
> hybrid of the previous two attempts, though - each layer gets to
> indicate to the layer below what it wants, but some layers may _also_
> use protocol specific data to further limit what is returned - am I
> right?

Correct. The upper layer has no idea what is available. All it can do is say
"give me data." It is the lower layers, who are handling the protocol, who
get to say "sorry. all done." and limit what is returned.

When you stop and think about division of responsibility and knowledge, this
pattern just falls right out.

> BTW, wouldn't a consequence of this be that a decompression filter (for
> example) may have to buffer data?

Possibly. Mostly, this just means holding a brigade off to the side. Not
very complicated code. Also note that the filter could simply request "half"
from the next filter down, decompress, and return that. That would generally
minimize the amount held (if any). If the decompression is higher, then you
could make the filter "learn" and start requesting "10%" from the next
filter down :-)  (just kidding)

It certainly doesn't pose a problem on the system. Again, the higher levels
will just keep saying "give me data". The decompression can return little
bits at a time if it wants. The upper levels ought to continue operating
just fine since we've removed all notion of "this much data". (since "this
much" is highly dependent upon what point in the input filter stack you want
to talk about: at the network? after decompression? after UTF-8 to UCS-2
conversion? etc)


Greg Stein,

View raw message