Re: Use an Apache handler after declining another

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



example1_handler is as given below:
module AP_MODULE_DECLARE_DATA example1_module;

static int example1_handler(request_rec *r)
{
    if (!r->handler || strcmp(r->handler, "example1-handler")) return (DECLINED);
    ap_set_content_type(r, "text/html");
    ap_rprintf(r, "Hello, world!");
    return OK;
}

static void register_hooks(apr_pool_t *pool)
{
    ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_MIDDLE);
}

AP_DECLARE_MODULE(example1) =
{
    STANDARD20_MODULE_STUFF,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    register_hooks
};

Their configuration directives are as given below:
<Location "/example1">
    SetHandler example1-handler
</Location>

<Location "/products.php">
    SetHandler example5-handler
</Location>

On Tue, Jul 19, 2016 at 6:01 PM, Yann Ylavic <ylavic.dev@xxxxxxxxx> wrote:
On Tue, Jul 19, 2016 at 2:15 PM, Amlaan Kar <amlaan.kar@xxxxxxxxx> wrote:
> static void register_hooks(apr_pool_t *pool)
> {
>     static const char *const succs[] = {"mod_example1.c", NULL };
>     ap_hook_handler(example5_handler, NULL, succs, APR_HOOK_FIRST);
> }
> AP_DECLARE_MODULE(example5) =
> {
>     STANDARD20_MODULE_STUFF,
>     NULL,
>     NULL,
>     NULL,
>     NULL,
>     NULL,
>     register_hooks};
>
>
> Sorry, I can't share the remaining code. I hope you can help me with this.

OK, so example5_handler() runs and returns DECLINED, but
example1_handler() does not run at all?

How is example1_handler hooked, which handler is taking the request?
Any special configuration in httpd.conf (*Handler) for these modules?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux