Commit 5b70cf0c authored by Eric Covener's avatar Eric Covener
Browse files

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
parent 61fa8a03
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
                                                         -*- 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]
+4 −6
Original line number Diff line number Diff line
@@ -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>

+0 −11
Original line number Diff line number Diff line
@@ -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>
@@ -332,12 +327,6 @@ by many requests.
    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
    illustration purposes only, and is not a recommendation. If you want
+1 −23
Original line number Diff line number Diff line
@@ -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);