httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rede...@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Mon, 14 Jul 2003 16:40:14 GMT
rederpj     2003/07/14 09:40:14

  Modified:    .        CHANGES
               modules/mappers mod_rewrite.c
  Log:
  mod_rewrite: fix a problem in the proxy support of mod_rewrite. The broken
  code was inserting multiple "proxy:" fields in the rewritten URIs.
  [Submitted by:  Eider Oliveira <eider@bol.com.br>]
  [Updated and reviewed by: Paul J. Reder]
  
  Revision  Changes    Path
  1.1222    +6 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1221
  retrieving revision 1.1222
  diff -u -r1.1221 -r1.1222
  --- CHANGES	14 Jul 2003 16:04:46 -0000	1.1221
  +++ CHANGES	14 Jul 2003 16:40:12 -0000	1.1222
  @@ -2,6 +2,12 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_rewrite: fix a problem in the proxy support of mod_rewrite.
  +     The broken code was inserting multiple "proxy:" fields in the
  +     rewritten URIs.
  +     [Submitted by:  Eider Oliveira <eider@bol.com.br>]
  +     [Updated and reviewed by: Paul J. Reder]
  +
     *) mod_actions: Propagate the handler name to the action script via
        the REDIRECT_HANDLER environment variable.  [André Malo]
   
  
  
  
  1.154     +23 -0     httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.153
  retrieving revision 1.154
  diff -u -r1.153 -r1.154
  --- mod_rewrite.c	7 Jun 2003 19:50:00 -0000	1.153
  +++ mod_rewrite.c	14 Jul 2003 16:40:13 -0000	1.154
  @@ -1104,6 +1104,7 @@
   static int hook_uri2file(request_rec *r)
   {
       rewrite_server_conf *conf;
  +    const char *saved_rulestatus;
       const char *var;
       const char *thisserver;
       char *thisport;
  @@ -1182,6 +1183,7 @@
                         thisurl, NULL);
       apr_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URI, var);
   
  +    if (!(saved_rulestatus = apr_table_get(r->notes,"already_rewritten"))) {
       /* if filename was not initially set,
        * we start with the requested URI
        */
  @@ -1190,11 +1192,25 @@
           rewritelog(r, 2, "init rewrite engine with requested uri %s",
                      r->filename);
       }
  +    else {
  +        rewritelog(r, 2, "init rewrite engine with passed filename %s."
  +                   " Original uri = %s", r->filename, r->uri);
  +    }
   
       /*
        *  now apply the rules ...
        */
       rulestatus = apply_rewrite_list(r, conf->rewriterules, NULL);
  +    apr_table_set(r->notes,"already_rewritten",
  +                  apr_psprintf(r->pool,"%d",rulestatus));
  +    }
  +    else {
  +        rewritelog(r, 2,
  +                   "uri already rewritten. Status %s, Uri %s, r->filename %s",
  +                   saved_rulestatus, r->uri, r->filename);
  +        rulestatus = atoi(saved_rulestatus);
  +    }
  +
       if (rulestatus) {
           unsigned skip;
   
  @@ -2816,6 +2832,13 @@
           }
           else if (!strncasecmp(uri, "ntp://", 6)) {  /* nntp://   */
               return 7;
  +        }
  +        break;
  +
  +    case 'p':
  +    case 'P':
  +        if (!strncasecmp(uri, "roxy:", 5)) {       /* proxy:   */
  +            return 6;
           }
           break;
       }
  
  
  

Mime
View raw message