]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_rewrite: Decline immediately if the rewrite engine is disabled, instead
authorGraham Leggett <minfrin@apache.org>
Sun, 13 Mar 2011 19:05:39 +0000 (19:05 +0000)
committerGraham Leggett <minfrin@apache.org>
Sun, 13 Mar 2011 19:05:39 +0000 (19:05 +0000)
of making various comparatively expensive proxy checks first.

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

modules/mappers/mod_rewrite.c

index 55fc459d9a1b9eac64240db285246ee52d17ed42..ef8bf6785504e685b8d9ab785da8d42fa0524168 100644 (file)
@@ -4680,6 +4680,14 @@ static int hook_fixup(request_rec *r)
         return DECLINED;
     }
 
+    /*
+     * only do something under runtime if the engine is really enabled,
+     * for this directory, else return immediately!
+     */
+    if (dconf->state == ENGINE_DISABLED) {
+        return DECLINED;
+    }
+
     /* if there are no real (i.e. no RewriteRule directives!)
        per-dir config of us, we return also immediately */
     if (dconf->directory == NULL) {
@@ -4706,14 +4714,6 @@ static int hook_fixup(request_rec *r)
         }
     }
 
-    /*
-     *  only do something under runtime if the engine is really enabled,
-     *  for this directory, else return immediately!
-     */
-    if (!dconf || dconf->state == ENGINE_DISABLED) {
-        return DECLINED;
-    }
-
     /* END flag was used as a RewriteRule flag on this request */ 
     apr_pool_userdata_get(&skipdata, really_last_key, r->pool);
     if (skipdata != NULL) {