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 14:24:24 GMT

> Um. I didn't explain well, then. Defining copy() and split() for PIPEs and
> SOCKETs actually simplifies the APIs. Callers don't have to worry about
> support or needing to read first or whatever.

No, you explained just fine.  You have two different semantics for
copy.  On most buckets, it just creates a second bucket that is an exact
copy of the first.  On pipe/socket buckets it reads data then copies the
bucket.  While this does make the API more simple in this one case, it
means that there are two meanings for copy, and that is not a good thing.

> > 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.
> If I have a PIPE, then it makes sense to say "split at 10 bytse". The result
> of the split is two buckets: the first 10 bytes of the PIPE, and the rest of
> the PIPE. How does this occur? Well, 10 bytes are read from the PIPE and
> form a HEAP bucket; the rest of the PIPE stays the same.
> There is a semantic, so lets implement it rather than making callers deal
> with the edge cases (buckets that can't split).

Again, now you have two meanings for split.  One is just split a bucket,
the other is read then split.  What happens with a pipe that has 5 bytes
if you ask for the split at 10?  In the heap case this is an error, and
the bucket is left untouched.  With a new menaing for split for
pipe/socket this is an error but the bucket is changed subtly.  This is


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

View raw message