You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by rb...@covalent.net on 2000/05/09 21:58:44 UTC

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

>   @@ -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
-------------------------------------------------------------------------------


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