httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: [Patch]:Move SSI "exec" directive support from mod_include to mod_cgi(d).
Date Sat, 20 Jan 2001 16:27:36 GMT
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.  :-)

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

> 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.  :-)

Ryan

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


Mime
View raw message