apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: [PATCH] Buckets: add copy function, ap_bucket_split_any(), etc
Date Mon, 11 Dec 2000 23:28:33 GMT
On Sat, Dec 09, 2000 at 03:24:08PM -0800, rbb@covalent.net wrote:
> 
> > Question: In the bucket split functions, a sanity check is performed on the point
> > passed in: if point is < 0 or > len, APR_EINVAL is returned.  What should
be the
> > brigade-splitting equivalent of that?  Should an empty brigade be returned, or
> > should the return value be NULL to make it more clear that there was an error? 
I'm
> > leaning toward NULL to distinguish between error cases and the case where the point
> > == brigade len.
> > 
> > Thoughts?
> 
> Any error condition should return NULL in ap_brigade_split_offset.

Also note that we generally don't want to validate arguments and return
APR_EINVAL. The assumption is the caller passes legal arguments.

len > brigade-len shouldn't be an error -- it should just be a no-op.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message