From 0d146565b9b635a60b46773c1d8a2b9da87099f6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 21 Feb 2002 17:20:26 +0000 Subject: [PATCH] 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 --- server/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.50.1