]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
revert "overloaded" recent additions to mod_rewrite
authorEric Covener <covener@apache.org>
Thu, 2 Feb 2012 21:51:36 +0000 (21:51 +0000)
committerEric Covener <covener@apache.org>
Thu, 2 Feb 2012 21:51:36 +0000 (21:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1239872 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/mod_rewrite.xml
docs/manual/rewrite/rewritemap.xml
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index dba3331f061922659e1aba19d92dedfadc3c04d0..fcb3cfd4ad85894fd8c09fcc1b24f8e946886142 100644 (file)
--- 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]
index 4448290dae334d1b0cd7b91b8fbd737a3e0d6890..50f84ca1ac8422e8e80129e33284fb6d089f41a9 100644 (file)
@@ -264,9 +264,9 @@ Apache HTTP Server 2.0.41 and later</compatibility>
         utility.  (<a href="../rewrite/rewritemap.html#dbm">Details ...</a>)</dd>
 
     <dt>int</dt>
-        <dd>One of the five available internal functions provided by
-        <code>RewriteMap</code>: toupper, tolower, escape, unescape, or sleep. 
-        (<a href="../rewrite/rewritemap.html#int">Details ...</a>)</dd>
+        <dd>One of the four available internal functions provided by
+        <code>RewriteMap</code>: toupper, tolower, escape or
+        unescape. (<a href="../rewrite/rewritemap.html#int">Details ...</a>)</dd>
 
     <dt>prg</dt>
         <dd>Calls an external program or script to process the
@@ -1041,9 +1041,7 @@ cannot use <code>$N</code> in the substitution string!
         <dd>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".</dd>
+        the path.</dd>
 
       </dl>
 
index 147d3b9b0e1b9f5319098f3969ccc5e26941cf0b..aa6386e2576d0bc84b894f8c8b227b361f18d54b 100644 (file)
@@ -315,11 +315,6 @@ by many requests.
       <li><strong>unescape</strong>:<br/>
              Translates hex-encodings in the key back to
             special characters.</li>
-      <li><strong>sleep</strong>:<br/>
-             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.
-            <p> Available since Apache HTTP Server 2.5.0</p> </li>
     </ul>
 
     <p>
@@ -331,12 +326,6 @@ by many requests.
     RewriteMap lc int:tolower<br />
     RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R]
     </example>
-    
-    <example><title>Delay a request by one half of a second</title>
-    RewriteMap sleep int:sleep<br />
-    RewriteRule ^/foo/bar.html -${sleep:"500ms"} 
-    </example>
-
 
     <note>
     <p>Please note that the example offered here is for
index a720139ad43994a096827c8f25509ac727b56071..8f5d3972ed19aa6d8107c34f03c1224c29dfef71 100644 (file)
@@ -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=<cookie>] */
@@ -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 <pat> -') 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);