httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject svn commit: r178018 - /httpd/httpd/trunk/server/core.c
Date Mon, 23 May 2005 20:54:10 GMT
Author: striker
Date: Mon May 23 13:54:10 2005
New Revision: 178018

URL: http://svn.apache.org/viewcvs?rev=178018&view=rev
Log:
Submitted by: RĂ¼diger Pluem <r.pluem@t-online.de>

* server/core.c

  (default_handler): Always give the filters a chance at processing
   the response.

Modified:
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/core.c?rev=178018&r1=178017&r2=178018&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Mon May 23 13:54:10 2005
@@ -3492,46 +3492,50 @@
         ap_set_etag(r);
         apr_table_setn(r->headers_out, "Accept-Ranges", "bytes");
         ap_set_content_length(r, r->finfo.size);
-        if ((errstatus = ap_meets_conditions(r)) != OK) {
-            apr_file_close(fd);
-            return errstatus;
-        }
-
-        if (bld_content_md5) {
-            apr_table_setn(r->headers_out, "Content-MD5",
-                           ap_md5digest(r->pool, fd));
-        }
 
         bb = apr_brigade_create(r->pool, c->bucket_alloc);
 
-        /* For platforms where the size of the file may be larger than
-         * that which can be stored in a single bucket (where 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);
-            while (fsize > AP_MAX_SENDFILE) {
-                apr_bucket *ce;
-                apr_bucket_copy(e, &ce);
-                APR_BRIGADE_INSERT_TAIL(bb, ce);
-                e->start += AP_MAX_SENDFILE;
-                fsize -= AP_MAX_SENDFILE;
+        if ((errstatus = ap_meets_conditions(r)) != OK) {
+            apr_file_close(fd);
+            r->status = errstatus;
+        } 
+        else {
+            if (bld_content_md5) {
+                apr_table_setn(r->headers_out, "Content-MD5",
+                               ap_md5digest(r->pool, fd));
+            }
+
+            /* For platforms where the size of the file may be larger than
+             * that which can be stored in a single bucket (where 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);
+                while (fsize > AP_MAX_SENDFILE) {
+                    apr_bucket *ce;
+                    apr_bucket_copy(e, &ce);
+                    APR_BRIGADE_INSERT_TAIL(bb, ce);
+                    e->start += AP_MAX_SENDFILE;
+                    fsize -= AP_MAX_SENDFILE;
+                }
+                e->length = (apr_size_t)fsize; /* Resize just the last bucket */
+            }
+            else {
+                e = apr_bucket_file_create(fd, 0, (apr_size_t)r->finfo.size,
+                                           r->pool, c->bucket_alloc);
             }
-            e->length = (apr_size_t)fsize; /* Resize just the last bucket */
-        }
-        else
-            e = apr_bucket_file_create(fd, 0, (apr_size_t)r->finfo.size,
-                                       r->pool, c->bucket_alloc);
 
 #if APR_HAS_MMAP
-        if (d->enable_mmap == ENABLE_MMAP_OFF) {
-            (void)apr_bucket_file_enable_mmap(e, 0);
-        }
+            if (d->enable_mmap == ENABLE_MMAP_OFF) {
+                (void)apr_bucket_file_enable_mmap(e, 0);
+            }
 #endif
-        APR_BRIGADE_INSERT_TAIL(bb, e);
+            APR_BRIGADE_INSERT_TAIL(bb, e);
+        }
+
         e = apr_bucket_eos_create(c->bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(bb, e);
 



Mime
View raw message