apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: types for bucket/brigade sizes (was: Re: bug in apr_brigade.c)
Date Thu, 24 Jan 2002 23:29:50 GMT
On Thu, Jan 24, 2002 at 08:59:42AM -0800, Justin Erenkrantz wrote:
> On Thu, Jan 24, 2002 at 01:33:58AM -0800, Greg Stein wrote:
> > We should do the following:
> > 
> > typedef apr_off_t apr_bucket_size_t;
> > typedef apr_off_t apr_brigade_size_t;
> > 
> > And then use the appropriate type. We can then monkey the underlying types
> > every six months when the conversaion comes up :-)
> +1.  
> I can see apr_bucket_read still returning apr_size_t - there is

In one of the other emails that I sent on the bucket/brigade stuff, I
explicitly stated that read() would return an apr_size_t. You simply cannot
return more than that.

> nothing that says that a bucket must return all of its data in
> one read (even if the size is known).  Hmm.  How would we handle
> that construction?  Would the underlying bucket split itself?

Like today, it would split itself, and return a portion.

> Or, could we handle it another way?  But, the bucket and brigade
> sizes should be consistent regardless.

Consistency isn't the driving factor. It simply ends up that way:

pupported Truth of Life: a bucket can represent a file, a pipe, or a socket,
  each of which can "hold" an apr_off_t of content.

corollary: a brigade must be at least that long.

Thus, they aren't consistent, but simply that we don't have a handy type for
representing a larger size for the brigade. If you really want to be
pedantic, their sizes can be "infinite". But we are reasonable men... :-)

> I will take a pass at seeing how hard this would be to implement
> this weekend.  -- justin

"this" being the new types?

I'd recommend a first pass where you add the new types. We can then set the
types to apr_uint8 and do a full compile. Then set them to apr_uint64 and do
a full compile. And then mix/match them :-)

The warnings/errors discovered will tell us a bundle... It will tell us
where we're mixing them inappropriately, and where we're making assumptions
about certain sizes.

Once the types are straightened out, then we can set them to appropriate


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

View raw message