httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: [Patch]:Move SSI "exec" directive support from mod_include to mod_cgi(d).
Date Sun, 21 Jan 2001 13:16:01 GMT
rbb@covalent.net wrote:
> 
> On Sat, 20 Jan 2001, Ben Laurie wrote:
> 
> > rbb@covalent.net wrote:
> > > The second problem is a bit different.  One module implements a function
> > > that another module uses.  This is the problem we are talking about
> > > here.  In this case, mod_include implements ap_register_include_handler,
> > > and mod_cgi(d) needs to use this function.
> >
> > Of course, one can bend generic hooks (that was a really stupid name
> 
> So change the name.  :-)  Nobody ever likes what I call things, I've
> gotten over it.  :-)

:-) Actually I am as much to blame as you on this one!

> > choice, btw) to do this: mod_cgi(d) creates a hook that mod_include
> > registers for. But this would be somewhat weird.
> >
> > So, moving on, I presume that there's a desire to avoid using the
> > standard dl stuff to do this (i.e. dlsym()) - why? Shouldn't APR provide
> > a facility to call (or not, as the case may be) a dynamically loaded
> > function? Or is this something that tends to not be portable?
> 
> APR already provides apr_dso_sym.  I guess we could do something as simple
> as:
> 
> if (modp = ap_find_linked_module("mod_include")) {
>     apr_dso_sym(&foo, modp->dynamic_handle, "ap_register_include_handler");
>     if (foo) {
>         foo(....);
>     }
>     else {
>         /* how do we get the symbol if the module was compiled into the
>          * core?
>          */
>     }
> }
> 
> That would probably work.  Now, we just throw that into a macro, and use
> it.  Unfortunately, this removes type-saftey, doesn't it.  That was
> something we were trying to avoid.

Typesafety gets added by making foo a pointer to a function of
appropriate type! Again, we probably want to macro-ize that.

> > If so, then I'd propose we do something just like generic hooks, only
> > the "other way round" - mod_include declares
> > ap_register_include_handler(), registers it with the core, which allows
> > it to be called by name (or resolved by name) when present, and use the
> > same kind of casting trick I used for generic hooks to render it
> > typesafe.
> 
> That was what I had originally envisioned, but I haven't really had the
> time to research the generic hooks, so I haven't done anything with it
> yet.  Please, please, please, if you have time today, pick one and
> implement it, then we can commit Paul's patch before the beta.  :-)

Where's Paul's patch? It'd help to know what I'm aiming at. Sadly it may
not be today, I have to do stuff with the kids and I have a massive
hangover, to boot.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Mime
View raw message