]> granicus.if.org Git - apache/commitdiff
This code should be a noop today. But I did not feel comfortable about
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 21 Feb 2002 17:20:26 +0000 (17:20 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 21 Feb 2002 17:20:26 +0000 (17:20 +0000)
  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

index 435030b9bab15f020c64099ce3217dbd3a54ea31..07fbd7bf11a4cb9395822ca12c83c4a8f3bfb3c1 100644 (file)
@@ -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;
         }