From: Eric Covener Date: Thu, 2 Feb 2012 21:51:36 +0000 (+0000) Subject: revert "overloaded" recent additions to mod_rewrite X-Git-Tag: 2.5.0-alpha~7501 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23c21127c00d79641d5b0eb04b27950fd759de25;p=thirdparty%2Fapache%2Fhttpd.git revert "overloaded" recent additions to mod_rewrite git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1239872 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index dba3331f061..fcb3cfd4ad8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,14 +1,6 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 - *) mod_rewrite: Add an internal RewriteMap function named "sleep" - that always returns an empty value and sleeps for the specified - interval. [Eric Covener] - - *) mod_rewrite: Treat a RewriteRule substitution that expands to - "-" to behave as if a literal "-" was used in the RewriteRule - (no substitution). [Eric Covener] - *) mod_authnz_ldap: Don't try a potentially expensive nested groups search before exhausting all AuthLDAPGroupAttribute checks on the current group. PR52464 [Eric Covener] diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index 4448290dae3..50f84ca1ac8 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -264,9 +264,9 @@ Apache HTTP Server 2.0.41 and later utility. (Details ...)
int
-
One of the five available internal functions provided by - RewriteMap: toupper, tolower, escape, unescape, or sleep. - (Details ...)
+
One of the four available internal functions provided by + RewriteMap: toupper, tolower, escape or + unescape. (Details ...)
prg
Calls an external program or script to process the @@ -1041,9 +1041,7 @@ cannot use $N in the substitution string!
A dash indicates that no substitution should be performed (the existing path is passed through untouched). This is used when a flag (see below) needs to be applied without changing - the path. In Apache HTTP Server 2.5.0 and later, a substitution - that ultimately expands to this single character is also treated as - "no substitution".
+ the path. diff --git a/docs/manual/rewrite/rewritemap.xml b/docs/manual/rewrite/rewritemap.xml index 147d3b9b0e1..aa6386e2576 100644 --- a/docs/manual/rewrite/rewritemap.xml +++ b/docs/manual/rewrite/rewritemap.xml @@ -315,11 +315,6 @@ by many requests.
  • unescape:
    Translates hex-encodings in the key back to special characters.
  • -
  • sleep:
    - Causes the request to sleep for the amount of time specified in - the key, in milliseconds. Keys are accepted in the form of - "2000", "2000ms", or "2s". This map always returns an empty value. -

    Available since Apache HTTP Server 2.5.0

  • @@ -331,12 +326,6 @@ by many requests. RewriteMap lc int:tolower
    RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R] - - Delay a request by one half of a second - RewriteMap sleep int:sleep
    - RewriteRule ^/foo/bar.html -${sleep:"500ms"} -
    -

    Please note that the example offered here is for diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index a720139ad43..8f5d3972ed1 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1083,21 +1083,6 @@ static char *rewrite_mapfunc_unescape(request_rec *r, char *key) return key; } -static char *rewrite_mapfunc_sleep(request_rec *r, char *key) -{ - apr_interval_time_t timeout; - apr_status_t rv; - - if ((rv = ap_timeout_parameter_parse(key, &timeout, "ms")) != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERROR, rv, r, APLOGNO(02295) - "Bad parameter to internal sleep map: '%s'", key); - } - else { - apr_sleep(timeout); - } - - return ""; -} static char *select_random_value_part(request_rec *r, char *value) { @@ -3924,7 +3909,6 @@ static int apply_rewrite_rule(rewriterule_entry *p, rewrite_ctx *ctx) char *newuri = NULL; request_rec *r = ctx->r; int is_proxyreq = 0; - int force_no_sub = 0; ctx->uri = r->filename; @@ -4038,11 +4022,6 @@ static int apply_rewrite_rule(rewriterule_entry *p, rewrite_ctx *ctx) newuri = do_expand(p->output, ctx, p); rewritelog((r, 2, ctx->perdir, "rewrite '%s' -> '%s'", ctx->uri, newuri)); - /* Allow a substitution to resolve to "-" and act like a literal "-" */ - if (newuri && *newuri == '-' && !newuri[1]) { - newuri = NULL; - force_no_sub = 1; - } } /* expand [E=var:val] and [CO=] */ @@ -4050,7 +4029,7 @@ static int apply_rewrite_rule(rewriterule_entry *p, rewrite_ctx *ctx) do_expand_cookie(p->cookie, ctx); /* non-substitution rules ('RewriteRule -') end here. */ - if (p->flags & RULEFLAG_NOSUB || force_no_sub) { + if (p->flags & RULEFLAG_NOSUB) { force_type_handler(p, ctx); if (p->flags & RULEFLAG_STATUS) { @@ -4317,7 +4296,6 @@ static int pre_config(apr_pool_t *pconf, map_pfn_register("toupper", rewrite_mapfunc_toupper); map_pfn_register("escape", rewrite_mapfunc_escape); map_pfn_register("unescape", rewrite_mapfunc_unescape); - map_pfn_register("sleep", rewrite_mapfunc_sleep); } dbd_acquire = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_acquire); dbd_prepare = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_prepare);