httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Harrison>
Subject why is my module being called for all pages?
Date Sun, 12 Aug 2007 22:13:02 GMT
warning: newbie alert!

I've got a simple module as detailed below.  I based it off
of the example module, stripping it down to the smallest
example I could.

It seems to be working, but it is getting called on all
web pages.  Can someone loan me a clue as to:

1.  why it is being called on all pages, not just the
     one I've specified in <Location>?

2.  what do I need to do to fix it?

Many TIA!

### httpd.conf
### I expect the that http://localhost/kaptest to trigger
### but not http://localhost/somewhere_else
LoadModule kap_module         modules/
<Location /kaptest>
SetHandler kap-handler

/* mod_kap.c -- simple handler */
/*headers as per mod_example */

module AP_MODULE_DECLARE_DATA kap_module;

static int kap_handler(request_rec *r)
     ap_set_content_type(r, "text/plain");
     ap_rprintf(r, "kap_handler: time=%d\n", time(NULL));
     return OK;

static void kap_register_hooks(apr_pool_t *p)
     ap_hook_handler(kap_handler, NULL, NULL, APR_HOOK_MIDDLE);

module AP_MODULE_DECLARE_DATA kap_module =
     NULL,                     /* per-directory config creator */
     NULL,                     /* dir config merger */
     NULL,                     /* server config creator */
     NULL,                     /* server config merger */
     NULL,                 /* command table */
     kap_register_hooks,       /* set up other request processing hooks */
/* eof: mod_kap.c */

Mark Harrison
Pixar Animation Studios

View raw message