]> granicus.if.org Git - apache/commitdiff
Straighten up the first-time-through check in mod_cgid and add a CHANGES
authorJeff Trawick <trawick@apache.org>
Wed, 13 Dec 2000 13:30:40 +0000 (13:30 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 13 Dec 2000 13:30:40 +0000 (13:30 +0000)
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

CHANGES
modules/generators/mod_cgid.c

diff --git a/CHANGES b/CHANGES
index ee6d4f09e551dcb692b0323d426dc50024f25e16..5ed04cce500106cf16af6902b1dc60ad7aa8d9b6 100644 (file)
--- 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
index 5a770e171348e926655275baa94cbeac75b4fc03..9ba730b1c645e583abe505a16ec13101aefd53a1 100644 (file)
@@ -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)