"Edward L. Abrams" <[EMAIL PROTECTED]> writes:

>   // dump the values in this brigade:
>   for (b = APR_BRIGADE_FIRST(bb);
>        b != APR_BRIGADE_SENTINEL(bb);
>        b = APR_BUCKET_NEXT(b))

This is the source of your leak.
What you need to do is copy the upload brigade
and iterate over it using something like


    while (!APR_BRIGADE_EMPTY(bb)) {
       apr_bucket_t *e = APR_BRIGADE_FIRST(bb);

       ...read from the bucket, do something with data...

       apr_bucket_delete(e);
    }


ie, destroy the buckets as you read from them.
reading from file buckets tends to convert those buckets
into heap buckets, and unless you delete them as you go,
you wind up copying the entire spool file into RAM.

-- 
Joe Schaefer

Reply via email to