Re: Newbie: Question
Joe Schaefer <[email protected]>
| Newsgroups | gmane.comp.apache.apreq |
|---|---|
| Message-ID | <[email protected]> |
"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