From: William A. Rowe Jr Date: Thu, 21 Feb 2002 17:20:26 +0000 (+0000) Subject: This code should be a noop today. But I did not feel comfortable about X-Git-Tag: 2.0.33~164 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d146565b9b635a60b46773c1d8a2b9da87099f6;p=apache This code should be a noop today. But I did not feel comfortable about 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 --- diff --git a/server/core.c b/server/core.c index 435030b9ba..07fbd7bf11 100644 --- a/server/core.c +++ b/server/core.c @@ -3103,8 +3103,9 @@ static int default_handler(request_rec *r) 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; }