apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henry Jen <henry...@ztune.net>
Subject apr_brigade_length to return length as is instead of undefined
Date Sun, 24 Sep 2006 02:40:31 GMT

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.


View raw message