httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: windows build & handler hook
Date Mon, 08 Jan 2001 23:33:30 GMT
Greg Stein wrote:
> 
> On Mon, Jan 08, 2001 at 02:03:56PM -0500, Allan Edwards wrote:
> >...
> > --- modules/cache/mod_file_cache.c    2000/12/13 13:22:51     1.34
> > +++ modules/cache/mod_file_cache.c    2001/01/08 18:43:33
> > @@ -416,12 +416,16 @@
> >      return OK;
> >  }
> >
> > -static int file_cache_handler(request_rec *r)
> > +static int file_cache_handler(const char *handler, request_rec *r)
> >  {
> >      a_file *match;
> >      int errstatus;
> >      int rc = OK;
> >
> > +    if (strcmp(handler, "*.*")) {
> > +        return DECLINED;
> > +    }
> > +
> >      /* we don't handle anything but GET */
> >      if (r->method_number != M_GET) return DECLINED;
> >
> > @@ -473,6 +477,7 @@
> >
> >  static void register_hooks(void)
> >  {
> > +    ap_hook_handler(file_cache_handler, NULL, NULL, AP_HOOK_MIDDLE);
> >      ap_hook_post_config(file_cache_post_config, NULL, NULL, AP_HOOK_MIDDLE);
> >      ap_hook_translate_name(file_cache_xlat, NULL, NULL, AP_HOOK_MIDDLE);
> >      /* This trick doesn't work apparently because the translate hooks
> > @@ -483,12 +488,6 @@
> >
> >  }
> >
> > -static const handler_rec file_cache_handlers[] =
> > -{
> > -    { "*/*", file_cache_handler },
> > -    { NULL }
> > -};
> > -
> 
> I think the strcmp() in hook function should just go away. Isn't that what
> "*/*" means? That it applies to all types?

In the old code, yes. My gut feeling is that it should really mean that
it applies to all types with a / in (i.e. all "real" MIME types, but no
"handler" types).

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