apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: apr_brigade_length to return length as is instead of undefined
Date Fri, 29 Sep 2006 15:33:21 GMT
On 9/23/06, Henry Jen <henryjen@ztune.net> wrote:
> Hi,
>
> apr_brigade_length with readall set to 1 will try to read from a bucket
> with length -1 to determine the value.
>
> Currently, if apr_bucket_read with the bucket of length -1 returns other
> than APR_SUCCESS, the length returned is undefined.
>
> In case of a socket bucket with a nonblocking socket, the return status
> could be EAGAIN and the length is still useful to determine value
> available at the moment. A use case, for example, is waiting for a
> certain amount of data to be available.
>
> I would propose to return the value up-to-date is better than undefined.
> The application can decide whether the value is meaningful with the
> returned status. Does this make sense?
>
> Attached is a simple path specifying the length.

Is total going to be the correct value in that case?  I know in
apr_file_read you can get stuff in *len even if an error has occurred,
can that occur with apr_bucket_read?  If so, it seems like you'd want
*length = total + *len, or something like that.

-garrett

Mime
View raw message