httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From field...@apache.org
Subject svn commit: r743837 - in /httpd/httpd/trunk: modules/cache/mod_file_cache.c server/core.c
Date Thu, 12 Feb 2009 18:58:10 GMT
Author: fielding
Date: Thu Feb 12 18:58:10 2009
New Revision: 743837

URL: http://svn.apache.org/viewvc?rev=743837&view=rev
Log:
ap_meets_conditions() should not be called until all of
the known content metadata has been set, so that said metadata
can be included in the condition tests and in a 304 response.

Modified:
    httpd/httpd/trunk/modules/cache/mod_file_cache.c
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/modules/cache/mod_file_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_file_cache.c?rev=743837&r1=743836&r2=743837&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_file_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_file_cache.c Thu Feb 12 18:58:10 2009
@@ -358,17 +358,17 @@
         apr_table_setn(r->headers_out, "Last-Modified", datestr);
     }
 
-    ap_set_etag(r);
-    if ((errstatus = ap_meets_conditions(r)) != OK) {
-       return errstatus;
-    }
-
     /* ap_set_content_length() always converts the same number and never
      * returns an error.  Accelerate it.
      */
     r->clength = match->finfo.size;
     apr_table_setn(r->headers_out, "Content-Length", match->sizestr);
 
+    ap_set_etag(r);
+    if ((errstatus = ap_meets_conditions(r)) != OK) {
+       return errstatus;
+    }
+
     /* Call appropriate handler */
     if (!r->header_only) {
         if (match->is_mmapped == TRUE)

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=743837&r1=743836&r2=743837&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Thu Feb 12 18:58:10 2009
@@ -3632,6 +3632,10 @@
         ap_set_etag(r);
         apr_table_setn(r->headers_out, "Accept-Ranges", "bytes");
         ap_set_content_length(r, r->finfo.size);
+        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);
 
@@ -3640,11 +3644,6 @@
             r->status = errstatus;
         }
         else {
-            if (bld_content_md5) {
-                apr_table_setn(r->headers_out, "Content-MD5",
-                               ap_md5digest(r->pool, fd));
-            }
-
             e = apr_brigade_insert_file(bb, fd, 0, r->finfo.size, r->pool);
 
 #if APR_HAS_MMAP



Mime
View raw message