httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: cvs commit: apache-2.0/src/main http_protocol.c
Date Thu, 09 Nov 2000 04:52:05 GMT
On Wed, 8 Nov 2000, Greg Stein wrote:

> On Wed, Nov 08, 2000 at 07:16:43PM -0800, wrote:
> > On Wed, 8 Nov 2000, Greg Stein wrote:
> >...
> > > PIPE and SOCKET need refcounting, but they cannot be copied. The data must
> > > first be acquired, then it can be copied.
> > 
> > We aren't copying data, we are copying the bucket, so the dup function
> > should just create a second bucket that points to the same
> > pipe/socket.
> That won't work. You can't have two buckets pointing to the same pipe/socket
> because they cannot each read() the pipe/socket.
> If a bucket represents a pipe which is known to have 10 bytes in it before
> the end-of-pipe (due to whatever protocol), and you copy the bucket, now you
> have two buckets: one with 10 bytes in it, and one with none. And it all
> just depends on which order you happen to read them from.
> To make it work, the pipe must read [into a heap bucket], then the copy is
> made. Effectively, if you call copy(), then the pipe will read in a chunk,
> create a heap bucket (adjust the brigade), then copy the heap bucket. Note
> that you may still have a pipe bucket remaining (after the newly-created
> heap bucket), and that bucket may need to be copied further.

No.  Now you have changed the definition of copy depending on the type of
the bucket.  That won't work, it makes the API too complex.  If the
pipe/socket buckets can't be copied until after they have been read, then
the copy function returns APR_ENOTIMPL.  We don't want the same function
to mean different things in different situations.

> To really get this stuff up to top perf, we would want functional copy() and
> split() operations on all bucket types.

Again, no.  If the split bucket doesn't make sense for a given bucket
type, then the split doesn't make sense.  The function will just have to
deal with a return code of APR_ENOTIMPL.


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message