httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: [users@httpd] Use an Apache handler after declining another
Date Tue, 19 Jul 2016 11:14:14 GMT
On Tue, Jul 19, 2016 at 12:29 PM, Amlaan Kar <amlaan.kar@gmail.com> wrote:
> I have two handlers to be accessed. My motive is to use the second handler
> if the first handler returns DECLINED.
>
> I have tried various combinations of SetHandler, AddHandler and AddType but
> none has worked as overriding takes place in all of these combinations.
>
> Is there any method in Apache to use more than one handler without
> overriding?

If the first handler (returning DECLINED) is yours, you can hook it by
specifying its successor(s), e.g.:

static void my_register_hooks(apr_pool_t *p)
{
    static const char * const succs[] = { "mod_running_after.c", NULL };

    ...
    ap_hook_handler(my_handler, NULL, succs, APR_HOOK_<WHATEVER>);
    ...
}

This works for any hook, also by specifying predecessor(s) instead of
the above NULL.

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message