httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: [PATCH] config tree bug (is anybody hitting one)???
Date Thu, 27 Apr 2000 11:55:57 GMT
Here is a patch that works for a larger set of cfg files :)

The problem (or one problem) seems to be that curr_parent/current
don't get set up properly when the first element of the cfg file is a
container. 

Maybe these changes will give you some hints.  With these changes,
this config file looks real pretty in ddd:

<IfModule prefork.c>
MinSpareServers 20
MaxSpareServers 40
</IfModule>
servername gobble

Without the changes, MinSpareServers is pointed to by the next pointer
of "<IfModule prefork.c>" and "</IfModule>" is supposedly dangling.

Index: main/http_config.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/main/http_config.c,v
retrieving revision 1.44
diff -u -r1.44 http_config.c
--- http_config.c	2000/04/26 07:14:32	1.44
+++ http_config.c	2000/04/27 11:53:38
@@ -865,6 +865,7 @@
 
     if (cmd_name[0] == '<') {
         if (cmd_name[1] != '/') {
+            newdir->container = 1;
             (*current) = ap_add_node(curr_parent, *current, newdir, 1);
         }
 	else if (*curr_parent == NULL) {
@@ -976,6 +977,12 @@
 
         if (*conftree == NULL && current != NULL) {
             *conftree = current;
+            if (!curr_parent) {
+                if (current->container) {
+                    curr_parent = current;
+                    current = NULL;
+                }
+            }
         }
     }
 
Index: include/util_cfgtree.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/include/util_cfgtree.h,v
retrieving revision 1.2
diff -u -r1.2 util_cfgtree.h
--- util_cfgtree.h	2000/04/24 12:00:43	1.2
+++ util_cfgtree.h	2000/04/27 11:53:38
@@ -65,6 +65,7 @@
     void *data;		/* directive's module can store add'l data here */
 
     /* ### these may go away in the future, but are needed for now */
+    int container;
     const char *filename;
     int line_num;
 


-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message