httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@apache.org>
Subject Re: [PATCH] modules/aaa use optional function to register
Date Sun, 15 Sep 2002 01:36:50 GMT
On Sat, Sep 14, 2002 at 09:28:44PM -0400, John K. Sterling wrote:
> 
> On Saturday, September 14, 2002, at 09:17 PM, Justin Erenkrantz wrote:
> >
> >Hmm.  Can we register an optional function twice?  Does that mean
> >that any module that uses the provider API has to 'optionally'
> >register these functions?  Eek.
> 
> i was thinking they would conditionally register (i.e. if it wasn't 
> there already)
> 
> >I'm starting to like the idea of mod_auth_common.  =)  -- justin
> 
> me too.  unless this provider registration functionality gets added 
> into the core.

Well, we could make a case for adding the provider API to the core
since DAV has essentially the same semantics.

Would (should) we use a two-key system?  Such as:

ap_register_provider(apr_pool_t *p, const char *provider_group,
	             const char *provider_name, void *provider);
ap_lookup_provider(const char *provider_group,
	           const char *provider_name);

ap_register_provider(p, "authn", "file", authn_file_provider);
ap_register_provider(p, "dav", "file", dav_file_provider);

mod_dav:
myprov = (dav_provider*) ap_lookup_provider(p, "dav", "file");

mod_auth_basic:
myprov = (authn_provider*) ap_lookup_provider(p, "authn", "file");

The only drawback I see is the loss of type-safety, but that's a
red herring anyway, since the storage for the providers is a
hash table...

What do you think?  -- justin

Mime
View raw message