View | Details | Raw Unified | Return to bug 13946
Collapse All | Expand All

(-)mod_rewrite.c (-1 / +19 lines)
Lines 1069-1074 Link Here
1069
static int hook_uri2file(request_rec *r)
1069
static int hook_uri2file(request_rec *r)
1070
{
1070
{
1071
    rewrite_server_conf *conf;
1071
    rewrite_server_conf *conf;
1072
    const char *saved_rulestatus;
1072
    const char *var;
1073
    const char *var;
1073
    const char *thisserver;
1074
    const char *thisserver;
1074
    char *thisport;
1075
    char *thisport;
Lines 1149-1154 Link Here
1149
                     thisurl, NULL);
1150
                     thisurl, NULL);
1150
    apr_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URI, var);
1151
    apr_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URI, var);
1151
1152
1153
    if (!(saved_rulestatus = apr_table_get(r->notes,"already_rewritten")))
1154
    {
1152
    /* if filename was not initially set,
1155
    /* if filename was not initially set,
1153
     * we start with the requested URI
1156
     * we start with the requested URI
1154
     */
1157
     */
Lines 1157-1167 Link Here
1157
        rewritelog(r, 2, "init rewrite engine with requested uri %s",
1160
        rewritelog(r, 2, "init rewrite engine with requested uri %s",
1158
                   r->filename);
1161
                   r->filename);
1159
    }
1162
    }
1160
1163
        else 
1164
        {
1165
            rewritelog(r, 2, "init rewrite engine with passed filename %s. Original uri = %s",
1166
                r->filename,r->uri);
1167
        }
1161
    /*
1168
    /*
1162
     *  now apply the rules ...
1169
     *  now apply the rules ...
1163
     */
1170
     */
1164
    rulestatus = apply_rewrite_list(r, conf->rewriterules, NULL);
1171
    rulestatus = apply_rewrite_list(r, conf->rewriterules, NULL);
1172
        apr_table_set(r->notes,"already_rewritten", apr_psprintf(r->pool,"%d",rulestatus));
1173
    }
1174
    else
1175
    {
1176
        rewritelog(r, 2, "uri already rewritten. Status %s, Uri %s, r->filename %s",saved_rulestatus,
1177
            r->uri,r->filename);
1178
        rulestatus = atoi(saved_rulestatus);
1179
    }
1180
1165
    if (rulestatus) {
1181
    if (rulestatus) {
1166
1182
1167
        if (strlen(r->filename) > 6 &&
1183
        if (strlen(r->filename) > 6 &&
Lines 2082-2087 Link Here
2082
            rewritelog(r, 2, "[per-dir %s] forcing proxy-throughput with %s",
2098
            rewritelog(r, 2, "[per-dir %s] forcing proxy-throughput with %s",
2083
                       perdir, r->filename);
2099
                       perdir, r->filename);
2084
        }
2100
        }
2101
        if (strncasecmp("proxy:",r->filename,6))
2085
        r->filename = apr_pstrcat(r->pool, "proxy:", r->filename, NULL);
2102
        r->filename = apr_pstrcat(r->pool, "proxy:", r->filename, NULL);
2086
        return 1;
2103
        return 1;
2087
    }
2104
    }
Lines 2679-2684 Link Here
2679
        || (i > 6 && strncasecmp(uri, "ftp://",    6) == 0)
2696
        || (i > 6 && strncasecmp(uri, "ftp://",    6) == 0)
2680
        || (i > 5 && strncasecmp(uri, "ldap:",     5) == 0)
2697
        || (i > 5 && strncasecmp(uri, "ldap:",     5) == 0)
2681
        || (i > 5 && strncasecmp(uri, "news:",     5) == 0)
2698
        || (i > 5 && strncasecmp(uri, "news:",     5) == 0)
2699
        || (i > 6 && strncasecmp(uri, "proxy:",    6) == 0)
2682
        || (i > 7 && strncasecmp(uri, "mailto:",   7) == 0) ) {
2700
        || (i > 7 && strncasecmp(uri, "mailto:",   7) == 0) ) {
2683
        return 1;
2701
        return 1;
2684
    }
2702
    }

Return to bug 13946