From: Graham Leggett Date: Sun, 13 Mar 2011 19:05:39 +0000 (+0000) Subject: mod_rewrite: Decline immediately if the rewrite engine is disabled, instead X-Git-Tag: 2.3.12~238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4be5710bbe019f513ba33d0cd8a03af14b4b7ad0;p=thirdparty%2Fapache%2Fhttpd.git mod_rewrite: Decline immediately if the rewrite engine is disabled, instead 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 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 55fc459d9a1..ef8bf678550 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -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) {