rse 98/03/04 05:55:11
Modified: src CHANGES src/modules/standard mod_rewrite.c mod_rewrite.h Log: Ok, here it comes: the last bugfix for mod_rewrite on my TODO list. It fixes the PR's problem the way Dean initially wanted: On-the-fly without changing any configuration structures. Revision Changes Path 1.685 +9 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.684 retrieving revision 1.685 diff -u -r1.684 -r1.685 --- CHANGES 1998/03/04 13:16:56 1.684 +++ CHANGES 1998/03/04 13:55:06 1.685 @@ -1,5 +1,14 @@ Changes with Apache 1.3b6 + *) Fix mod_rewrite for the ugly API case where <VirtualHost> sections exist + but without any RewriteXXXXX directives. Here mod_rewrite is given no + chance by the API to initialise its per-server configuration and thus + receives the wrong one from the main server. This is now avoided by + remembering the server together with the config structure while + configuring and later assuming there is no config when we see a + difference between the remembered server and the one calling us. + [Ralf S. Engelschall, PR#1790] + *) Fixed the DBM RewriteMap support for mod_rewrite: First the support now is automatically disabled under configure time when the dbm_xxx functions are not available. Second, two heavy source code errors in the DBM 1.81 +13 -0 apache-1.3/src/modules/standard/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- mod_rewrite.c 1998/03/04 13:16:59 1.80 +++ mod_rewrite.c 1998/03/04 13:55:08 1.81 @@ -271,6 +271,7 @@ a->rewritemaps = make_array(p, 2, sizeof(rewritemap_entry)); a->rewriteconds = make_array(p, 2, sizeof(rewritecond_entry)); a->rewriterules = make_array(p, 2, sizeof(rewriterule_entry)); + a->server = s; return (void *)a; } @@ -285,6 +286,7 @@ a->state = overrides->state; a->options = overrides->options; + a->server = overrides->server; if (a->options & OPTION_INHERIT) { /* @@ -971,6 +973,17 @@ * else return immediately! */ if (conf->state == ENGINE_DISABLED) + return DECLINED; + + /* + * check for the ugly API case of a virtual host section where no + * mod_rewrite directives exists. In this situation we became no chance + * by the API to setup our default per-server config so we have to + * on-the-fly assume we have the default config. But because the default + * config has a disabled rewriting engine we are lucky because can + * just stop operating now. + */ + if (conf->server != r->server) return DECLINED; /* 1.44 +1 -0 apache-1.3/src/modules/standard/mod_rewrite.h Index: mod_rewrite.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- mod_rewrite.h 1998/03/04 13:17:00 1.43 +++ mod_rewrite.h 1998/03/04 13:55:09 1.44 @@ -263,6 +263,7 @@ array_header *rewritemaps; /* the RewriteMap entries */ array_header *rewriteconds; /* the RewriteCond entries (temporary) */ array_header *rewriterules; /* the RewriteRule entries */ + server_rec *server; /* the corresponding server indicator */ } rewrite_server_conf;