httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Murcko <ch...@topsail.org>
Subject Re: conf.h and httpd.h and proxy module
Date Wed, 09 Apr 1997 00:34:40 GMT
Marc Slemko wrote:
> 
> On Tue, 8 Apr 1997, Chuck Murcko wrote:
> 
> > Jim Jagielski wrote:
> > >
> > > Chuck Murcko wrote:
> > > >
> > > > Marc Slemko wrote:
> > > > >
> > > > > right now things can include conf.h or httpd.h, but things break
if they
> > > > > do both.
> > > > >
> > > > Why is it lame to assume that core .h files should be includable by
> > > > other things? Especially conf.h? This sounds like some other side
> > > > effect, somehow. That says to me that we're accumulating a list of
> > > > gotchas for module writers and others. The regex stuff was an example
of
> > > > that.
> > > >
> > >
> > > Scuuze me.... but httpd.h includes conf.h itself.
> > >
> > Which is why mod_proxy.h only includes httpd.h. I somehow don't
> > understand the problem here. Wrapping headers in #ifdefs is a lame
> > exercise for those who don't understand how headers work, who like to
> > #include everything that looks relevant, you see it all over Sun code.
> 
> mod_proxy.h is a header file for mod_proxy.  That would seem to imply that
> it handles things dealing with mod_proxy.  conf.h handles things dealing
> with configuration.  httpd.h handles general server things.  Some files
> include conf.h.  Some include httpd.h.  It would be reasonable to say that
> no file except httpd.h should include conf.h.  If you do that, however,
> you should make things actually work that way.
> 
> mod_proxy.h, however, is not so clear.  Is mod_proxy.h for things relating
> to the proxy or for proxy files to include?  I am uncomfortable relying on
> the assumption that mod_proxy.h will always include httpd.h (which
> includes conf.h), especially since if it stops doing that it could create
> bugs which are difficult to notice.
> 
> The problem is the lack of a clearly defined hierarchy for include files,
> mostly mod_proxy.h.  If mod_proxy.h is supposed to give files in the proxy
> directory access to all they normally need to know about the entire
> server, that should be stated clearly in a comment.

Oh, OK. Mod_proxy.h does a) expose the lack of a suitable includes
hierarchy, and b) gives files in the proxy directory access to a LCD
(minimum) of what they need to know about the base source. You'll notice
that specific proxy files also have individual includes needs, and deal
with those separately, and I will add a comment which states these
things to mod_proxy.h.

Funny thing, Marc. This was only an issue for me when I moved
mod_proxy.c to its own subdir, and split it up into functional parts.
Doug MacEachern of mod_proxy has also dealt with this stuff, and Ken now
also has some knowledge of it due to writing mod_example. Thanks for
noticing that things aren't totally neat and clean about this
(seriously) because it'll be a Good Thing to remember when we build 2.0.

#Including conf.h in httpd.h wasn't such a big deal when everything
about Apache lived in one subdirectory. I'm just dealing with that
legacy as best and coherently as I can until we go for 2.0, rather than
requiring massive changes to the base code and other modules (the latter
actually should be under the src/modules directory for 2.0, anyway).
-- 
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
chuck@topsail.org

Mime
View raw message