httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Wed, 13 Oct 2004 17:23:12 GMT
minfrin     2004/10/13 10:23:12

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               modules/mappers Tag: APACHE_2_0_BRANCH mod_rewrite.c
  Log:
  mod_rewrite: Handle per-location rules when r->filename is unset.
  Previously this would segfault or simply not match as expected,
  depending on the platform.
  Submitted by:	trawick
  Reviewed by:	trawick, geoff, jerenkrantz
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.372 +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.371
  retrieving revision 1.988.2.372
  diff -u -r1.988.2.371 -r1.988.2.372
  --- CHANGES	13 Oct 2004 17:12:08 -0000	1.988.2.371
  +++ CHANGES	13 Oct 2004 17:23:07 -0000	1.988.2.372
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.53
   
  +  *) mod_rewrite: Handle per-location rules when r->filename is unset.
  +     Previously this would segfault or simply not match as expected,
  +     depending on the platform.  [Jeff Trawick]
  +
     *) mod_rewrite: Fix query string handling for proxied URLs. PR 14518.
        [michael teitler <michael.teitler cetelem.fr>,
         Jan Kratochvil <rcpt-dev.AT.httpd.apache.org jankratochvil.net>]
  
  
  
  1.751.2.1119 +1 -7      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.1118
  retrieving revision 1.751.2.1119
  diff -u -r1.751.2.1118 -r1.751.2.1119
  --- STATUS	13 Oct 2004 17:12:08 -0000	1.751.2.1118
  +++ STATUS	13 Oct 2004 17:23:10 -0000	1.751.2.1119
  @@ -138,12 +138,6 @@
          +1: nd, jerenkrantz, minfrin
          minfrin: applied to v2.0
   
  -    *) mod_rewrite: Handle per-location rules when r->filename is unset.
  -       Previously this would segfault or simply not match as expected,
  -       depending on the platform.
  -         modules/mappers/mod_rewrite.c: r1.260
  -       +1: trawick, geoff, jerenkrantz
  -
       *) mod_headers: Support {...}s tag for SSL variable lookup.
          http://www.apache.org/~jorton/mod_headers-2.0-ssl.diff
          +1: jorton, trawick
  
  
  
  No                   revision
  No                   revision
  1.135.2.33 +10 -1     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.135.2.32
  retrieving revision 1.135.2.33
  diff -u -r1.135.2.32 -r1.135.2.33
  --- mod_rewrite.c	13 Oct 2004 17:12:09 -0000	1.135.2.32
  +++ mod_rewrite.c	13 Oct 2004 17:23:12 -0000	1.135.2.33
  @@ -1477,9 +1477,17 @@
        *  remember the current filename before rewriting for later check
        *  to prevent deadlooping because of internal redirects
        *  on final URL/filename which can be equal to the inital one.
  +     *  also, we'll restore original r->filename if we decline this
  +     *  request
        */
       ofilename = r->filename;
   
  +    if (r->filename == NULL) {
  +        r->filename = apr_pstrdup(r->pool, r->uri);
  +        rewritelog((r, 2, "init rewrite engine with requested uri %s",
  +                    r->filename));
  +    }
  +
       /*
        *  now apply the rules ...
        */
  @@ -1631,7 +1639,7 @@
                * use the following internal redirection stuff because
                * this would lead to a deadloop.
                */
  -            if (strcmp(r->filename, ofilename) == 0) {
  +            if (ofilename != NULL && strcmp(r->filename, ofilename) == 0) {
                   rewritelog(r, 1, "[per-dir %s] initial URL equal rewritten "
                              "URL: %s [IGNORING REWRITE]",
                              dconf->directory, r->filename);
  @@ -1688,6 +1696,7 @@
       else {
           rewritelog(r, 1, "[per-dir %s] pass through %s",
                      dconf->directory, r->filename);
  +        r->filename = ofilename;
           return DECLINED;
       }
   }
  
  
  

Mime
View raw message