]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r105111 from trunk:
authorJoe Orton <jorton@apache.org>
Thu, 20 Jan 2005 09:45:58 +0000 (09:45 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 20 Jan 2005 09:45:58 +0000 (09:45 +0000)
* server/core.c (default_handler): Fix the test for whether to split a
file into several buckets: it is needed regardless of whether sendfile
is enabled, and APR_HAS_LARGE_FILES is not sufficient to determine
whether sizeof(apr_off_t) is greater than sizeof(apr_off_t).

PR: 28898
Reviewed by: jorton, trawick, stoddard

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@125748 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
server/core.c

diff --git a/CHANGES b/CHANGES
index f53888d39bc7ba8fe16fc86f457387f1fd6eec5a..65d332a7471c3ba290a27db67cc129ee1addbdcb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.53
 
+  *) Fix handling of files >2Gb on all platforms (or builds) where
+     apr_off_t is larger than apr_size_t.  PR 28898.  [Joe Orton]
+
   *) mod_include: Fix bug which could truncate variable expansions
      of N*64 characters by one byte.  PR 32985.  [Joe Orton]
 
diff --git a/STATUS b/STATUS
index c9dc58d27bf7a4e23cb0fd010d8aab94b93e55f5..0f64bbca0f290dcfb3363701a4fea38fe4468dbf 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -94,12 +94,6 @@ PATCHES TO BACKPORT FROM 2.1
        PR: 32529
        +1: jorton
 
-    *) core: fix bucket-splitting logic for platforms with
-       sizeof(apr_off_t)>sizeof(apr_size_t)
-       http://www.apache.org/~jorton/ap_splitlfs.diff
-       PR: 28898
-       +1: jorton, trawick, stoddard
-
     *) modules/config5.m4 & docs/manual/programs/configure.xml:
        --with-module can now take more than one module to be statically
        linked:
index cf23bbdb77c7e86473f009115e72eae56a0ed133..f9e0857669eadd3e81d5aa20b4e5522a27e8bcac 100644 (file)
@@ -3580,17 +3580,13 @@ static int default_handler(request_rec *r)
         }
 
         bb = apr_brigade_create(r->pool, c->bucket_alloc);
-#if APR_HAS_LARGE_FILES
-#if APR_HAS_SENDFILE
-        if ((d->enable_sendfile != ENABLE_SENDFILE_OFF) &&
-#else
-        if (
-#endif
-            (r->finfo.size > AP_MAX_SENDFILE)) {
-            /* APR_HAS_LARGE_FILES issue; must split into mutiple buckets,
-             * no greater than MAX(apr_size_t), and more granular than that
-             * in case the brigade code/filters attempt to read it directly.
-             */
+
+        /* For platforms where the size of the file may be larger than
+         * that which can be stored in a single bucket (whether the
+         * length field is an apr_size_t), split it into several
+         * buckets */
+        if (sizeof(apr_off_t) > sizeof(apr_size_t) 
+            && r->finfo.size > AP_MAX_SENDFILE) {
             apr_off_t fsize = r->finfo.size;
             e = apr_bucket_file_create(fd, 0, AP_MAX_SENDFILE, r->pool,
                                        c->bucket_alloc);
@@ -3604,7 +3600,6 @@ static int default_handler(request_rec *r)
             e->length = (apr_size_t)fsize; /* Resize just the last bucket */
         }
         else
-#endif
             e = apr_bucket_file_create(fd, 0, (apr_size_t)r->finfo.size,
                                        r->pool, c->bucket_alloc);