httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Wed, 13 Dec 2000 13:03:34 GMT
trawick     00/12/13 05:03:33

  Modified:    modules/mappers mod_rewrite.c
  Log:
  Get mod_rewrite to work as a DSO by changing the way it
  keeps track of whether or not its post config hook has
  been called before.  Instead of a static variable (which
  is replaced when the DSO is loaded a second time), use
  userdata in the process pool.
  
  Revision  Changes    Path
  1.56      +11 -4     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.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- mod_rewrite.c	2000/12/01 21:49:25	1.55
  +++ mod_rewrite.c	2000/12/13 13:03:32	1.56
  @@ -243,7 +243,6 @@
   
       /* whether proxy module is available or not */
   static int proxy_available;
  -static int once_through = 0;
   
   static const char *lockname;
   static apr_lock_t *rewrite_mapr_lock = NULL;
  @@ -989,6 +988,16 @@
                           server_rec *s)
   {
       apr_status_t rv;
  +    void *data;
  +    int first_time = 0;
  +    const char *userdata_key = "rewrite_init_module";
  +
  +    apr_get_userdata(&data, userdata_key, s->process->pool);
  +    if (!data) {
  +        first_time = 1;
  +        apr_set_userdata((const void *)1, userdata_key,
  +                         apr_null_cleanup, s->process->pool);
  +    }
   
       /* check if proxy module is available */
       proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL);
  @@ -1010,11 +1019,9 @@
        */
       for (; s; s = s->next) {
           open_rewritelog(s, p);
  -        if (once_through > 0)
  +        if (!first_time)
              run_rewritemap_programs(s, p);
       }
  -
  -    once_through++;
   }
   
   
  
  
  

Mime
View raw message