You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Graham Leggett <mi...@sharp.fm> on 2005/08/17 02:39:49 UTC

apr_bucket_read() and data lifetimes

Hi all,

I have a deluge of a few questions about the apr_bucket_read() function 
within apr-util.

When you call it, it returns a buffer containing a length of data. When 
I tried to use it on a 1.7MB file, it gave me the entire 1.7MB of data 
in one go in a single buffer. What would happen if the file was 1GB in 
size? Is there a cut off point somewhere for this?

When the bucket is deleted using apr_bucket_delete(), is the bucket 
deleted straight away, or only when the enclosing pool is cleared?

Regards,
Graham
--


Re: apr_bucket_read() and data lifetimes

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Aug 17, 2005 at 02:39:49AM +0200, Graham Leggett wrote:
> I have a deluge of a few questions about the apr_bucket_read() function 
> within apr-util.
> 
> When you call it, it returns a buffer containing a length of data. 
> When I tried to use it on a 1.7MB file, it gave me the entire 1.7MB of 
> data in one go in a single buffer. What would happen if the file was 
> 1GB in size? Is there a cut off point somewhere for this?

You get a large buffer like that if the file gets mmap'ed into memory - 
yes, there is an upper limit, APR_MMAP_LIMIT (4Mb by default) per 
bucket.

> When the bucket is deleted using apr_bucket_delete(), is the bucket 
> deleted straight away, or only when the enclosing pool is cleared?

Straight away, essentially.

joe