You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2012/02/02 22:51:37 UTC

svn commit: r1239872 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_rewrite.xml docs/manual/rewrite/rewritemap.xml modules/mappers/mod_rewrite.c

Author: covener
Date: Thu Feb  2 21:51:36 2012
New Revision: 1239872

URL: http://svn.apache.org/viewvc?rev=1239872&view=rev
Log:
revert "overloaded" recent additions to mod_rewrite

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
    httpd/httpd/trunk/docs/manual/rewrite/rewritemap.xml
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1239872&r1=1239871&r2=1239872&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu Feb  2 21:51:36 2012
@@ -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]

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?rev=1239872&r1=1239871&r2=1239872&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Thu Feb  2 21:51:36 2012
@@ -264,9 +264,9 @@ Apache HTTP Server 2.0.41 and later</com
         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 substi
         <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>
 

Modified: httpd/httpd/trunk/docs/manual/rewrite/rewritemap.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewritemap.xml?rev=1239872&r1=1239871&r2=1239872&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/rewritemap.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/rewritemap.xml Thu Feb  2 21:51:36 2012
@@ -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

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1239872&r1=1239871&r2=1239872&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Thu Feb  2 21:51:36 2012
@@ -1083,21 +1083,6 @@ static char *rewrite_mapfunc_unescape(re
 
     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(rewriterul
     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(rewriterul
         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(rewriterul
     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);