httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Jones" <jones...@gmail.com>
Subject Re: why is my module being called for all pages?
Date Sun, 12 Aug 2007 22:28:26 GMT
On 8/12/07, Mark Harrison <mh@pixar.com> wrote:
> 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>?

that's to be expected.

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

you have to compare the request_rec->handler field to the handler name
you specified in the config with the SetHandler directive. For
example, if you have:

<Location /mylocation>
    SetHandler myhandler
</Location>

in your config, then your module will need to do something like this
in whatever function you registered as the handler function:

    if (strcmp(r->handler, "myhandler")) {
        return DECLINED;
    }


Frank

Mime
View raw message