From: Jeff Trawick Date: Wed, 13 Dec 2000 13:30:40 +0000 (+0000) Subject: Straighten up the first-time-through check in mod_cgid and add a CHANGES X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4f4781244d53f633fbd251f70ecaf310f515d72;p=apache Straighten up the first-time-through check in mod_cgid and add a CHANGES entry for the bug fixes to mod_rewrite and mod_cgid. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87330 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index ee6d4f09e5..5ed04cce50 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with Apache 2.0b1 + *) Get mod_cgid and mod_rewrite to work as DSOs by changing the way + they keep track of whether or not their 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. + [Jeff Trawick] + Changes with Apache 2.0a9 *) Win32 now requires perl to complete the final install step for users diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 5a770e1713..9ba730b1c6 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -515,9 +515,17 @@ static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, pid_t pid; apr_proc_t *procnew; void *data; + int first_time = 0; + const char *userdata_key = "cgid_init"; + + apr_get_userdata(&data, userdata_key, main_server->process->pool); + if (!data) { + first_time = 1; + apr_set_userdata((const void *)1, userdata_key, + apr_null_cleanup, main_server->process->pool); + } - apr_get_userdata(&data, "cgid_init", main_server->process->pool); - if (data != NULL) { + if (!first_time) { apr_create_pool(&pcgi, p); if ((pid = fork()) < 0) { @@ -536,10 +544,6 @@ static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, apr_register_other_child(procnew, cgid_maint, NULL, NULL, p); #endif } - else { - apr_set_userdata((const void *)1, "cgid_init", apr_null_cleanup, - main_server->process->pool); - } } static void *create_cgid_config(apr_pool_t *p, server_rec *s)