]> granicus.if.org Git - apache/commitdiff
Small performance fix: delay variable initialization in
authorBrian Pane <brianp@apache.org>
Thu, 6 Dec 2001 02:57:19 +0000 (02:57 +0000)
committerBrian Pane <brianp@apache.org>
Thu, 6 Dec 2001 02:57:19 +0000 (02:57 +0000)
ap_meets_conditions() until after the point where we
short-circuit out of the function on subrequests

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92354 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_protocol.c

index f30acbd3cc6ccc65d9aa2b97b4cc07fbd22d8d14..a5cf8f37b856463fa906cd1048dfa225fb8eb1b0 100644 (file)
@@ -198,7 +198,7 @@ AP_DECLARE(int) ap_set_keepalive(request_rec *r)
 
 AP_DECLARE(int) ap_meets_conditions(request_rec *r)
 {
-    const char *etag = apr_table_get(r->headers_out, "ETag");
+    const char *etag;
     const char *if_match, *if_modified_since, *if_unmodified, *if_nonematch;
     apr_time_t mtime;
 
@@ -217,6 +217,8 @@ AP_DECLARE(int) ap_meets_conditions(request_rec *r)
         return OK;
     }
 
+    etag = apr_table_get(r->headers_out, "ETag");
+
     /* XXX: we should define a "time unset" constant */
     mtime = (r->mtime != 0) ? r->mtime : apr_time_now();