httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1594648 - /httpd/httpd/trunk/modules/cache/cache_util.c
Date Wed, 14 May 2014 17:34:05 GMT
Author: ylavic
Date: Wed May 14 17:34:05 2014
New Revision: 1594648

URL: http://svn.apache.org/r1594648
Log:
mod_cache: follow up to r1594643.

Avoid table lookup if not necessary (fast path first).

Modified:
    httpd/httpd/trunk/modules/cache/cache_util.c

Modified: httpd/httpd/trunk/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.c?rev=1594648&r1=1594647&r2=1594648&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.c Wed May 14 17:34:05 2014
@@ -1256,14 +1256,14 @@ apr_table_t *cache_merge_headers_out(req
                                     r->err_headers_out);
     apr_table_clear(r->err_headers_out);
 
-    if (!apr_table_get(headers_out, "Content-Type")
-            && r->content_type) {
+    if (r->content_type
+            && !apr_table_get(headers_out, "Content-Type")) {
         apr_table_setn(headers_out, "Content-Type",
                        ap_make_content_type(r, r->content_type));
     }
 
-    if (!apr_table_get(headers_out, "Content-Encoding")
-            && r->content_encoding) {
+    if (r->content_encoding
+            && !apr_table_get(headers_out, "Content-Encoding")) {
         apr_table_setn(headers_out, "Content-Encoding",
                        r->content_encoding);
     }



Mime
View raw message