From: Jeff Trawick Date: Wed, 13 Dec 2000 13:03:32 +0000 (+0000) Subject: Get mod_rewrite to work as a DSO by changing the way it X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30eedf752eeb80bfff5d8af4442c3effca699dbd;p=apache 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87328 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 038c79c79d..5cb5b87764 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -243,7 +243,6 @@ static cache *cachep; /* 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 @@ static void init_module(apr_pool_t *p, 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 @@ static void init_module(apr_pool_t *p, */ for (; s; s = s->next) { open_rewritelog(s, p); - if (once_through > 0) + if (!first_time) run_rewritemap_programs(s, p); } - - once_through++; }