You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ak...@locus.apache.org on 2000/05/10 00:46:04 UTC

cvs commit: apache-2.0/src/main http_config.c

ake         00/05/09 15:46:04

  Modified:    src/main http_config.c
  Log:
  Get tree build to work correctly with config Include directive
  
  Revision  Changes    Path
  1.45      +3 -0      apache-2.0/src/main/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- http_config.c	2000/04/26 07:14:32	1.44
  +++ http_config.c	2000/05/09 22:46:03	1.45
  @@ -974,6 +974,9 @@
   	if (errmsg != NULL)
   	    return errmsg;
   
  +        if (*conftree == NULL && curr_parent != NULL) { 
  +            *conftree = curr_parent;
  +        }
           if (*conftree == NULL && current != NULL) {
               *conftree = current;
           }
  
  
  

RE: cvs commit: apache-2.0/src/main http_config.c

Posted by Allan Edwards <ak...@raleigh.ibm.com>.
>
> >   @@ -974,6 +974,9 @@
> >    	if (errmsg != NULL)
> >    	    return errmsg;
> >
> >   +        if (*conftree == NULL && curr_parent != NULL)

> >   +            *conftree = curr_parent;
> >   +        }
> >            if (*conftree == NULL && current != NULL) {
> >                *conftree = current;
> >            }
>
> I don't understand what this does.  The Include directive is
> just another
> directive, so it really shouldn't affect building the config
> tree.  Now,
> how to actually use the Include directive is a completely separate
> problem.  What was the problem you were hitting, and how does
> this solve
> it?
>
> Ryan
>
The problem can be demonstrated by having httpd.conf include a file that has a container as its
first directive, and which contains a directive that is not valid outside that container's scope.
e.g.
<Directory "c:/apache/htdocs">
	AllowOverride All
</Directory>

The situation was that when ap_build_config got called (for the included config file) and
ap_build_config_sub got called for the first time with the container directive, it set curr_parent
not current, and thus the container directive got omitted from conftree.

The additional check ensures that conftree will get initialized correctly in this case.

You're correct in that there is nothing wrong with the Include directive itself (that was just the
testcase), in fact I believe if httpd.conf has a container as its first directive you can get
similar failures. Hope this clarifies...

Allan


Re: cvs commit: apache-2.0/src/main http_config.c

Posted by rb...@covalent.net.
>   @@ -974,6 +974,9 @@
>    	if (errmsg != NULL)
>    	    return errmsg;
>    
>   +        if (*conftree == NULL && curr_parent != NULL) { 
>   +            *conftree = curr_parent;
>   +        }
>            if (*conftree == NULL && current != NULL) {
>                *conftree = current;
>            }

I don't understand what this does.  The Include directive is just another
directive, so it really shouldn't affect building the config tree.  Now,
how to actually use the Include directive is a completely separate
problem.  What was the problem you were hitting, and how does this solve
it?

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------