reusing/recopying each bucket -after- inserting it into the brigade.
Also, copying bucket c from b from a seemed obtuse.
This patch creates the single bucket, makes a copy of it for each
sendfile chunk we are about to add to the brigade, and finally consumes
that initial bucket as the final file bucket of the brigade.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93534
13f79535-47bb-0310-9956-
ffa450edef68
apr_off_t fsize = r->finfo.size;
e = apr_bucket_file_create(fd, 0, AP_MAX_SENDFILE, r->pool);
while (fsize > AP_MAX_SENDFILE) {
- APR_BRIGADE_INSERT_TAIL(bb, e);
- apr_bucket_copy(e, &e);
+ apr_bucket *ce;
+ apr_bucket_copy(e, &ce);
+ APR_BRIGADE_INSERT_TAIL(bb, ce);
e->start += AP_MAX_SENDFILE;
fsize -= AP_MAX_SENDFILE;
}