Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Amlaan Kar
What the example5-handler does is that it parses the url entered and if the url does not satisfy the given conditions, displays a message. However, if the conditions are satisfied by the url entered the example5-handler returns DECLINED. This is where the example1-handler is called and executed.

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Yann Ylavic
On Tue, Jul 19, 2016 at 4:21 PM, Yann Ylavic wrote: > > There are other ways to do this (by setting an environment variable > with for example SetEnvIf, and checking it in your handler), in any > case a DECLINing handler should not have to deal with r->handler > unless it knows which handler to fo

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Yann Ylavic
On Tue, Jul 19, 2016 at 2:42 PM, Amlaan Kar wrote: > 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); So it does nothing un

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Amlaan Kar
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

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Yann Ylavic
On Tue, Jul 19, 2016 at 2:15 PM, Amlaan Kar 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_M

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Amlaan Kar
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, r

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Amlaan Kar
The first handler runs properly. However, the successor does not run. The module I am using has been written by me and is not a built-in one. Is there any separate method for httpd built-in handlers? On Tue, Jul 19, 2016 at 5:37 PM, Yann Ylavic wrote: > On Tue, Jul 19, 2016 at 1:58 PM, Amlaan

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Yann Ylavic
On Tue, Jul 19, 2016 at 1:58 PM, Amlaan Kar wrote: > Thank You for answering. The method described above is not working. Please describe not working.. Your handler does not run before the one you specified as successor ? > Do I > have to make any changes before using the above given code? > PS:

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Amlaan Kar
Thank You for answering. The method described above is not working. Do I have to make any changes before using the above given code? PS: Both the handlers work properly individually On Tue, Jul 19, 2016 at 4:44 PM, Yann Ylavic wrote: > On Tue, Jul 19, 2016 at 12:29 PM, Amlaan Kar wrote: > > I h

Re: [users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Yann Ylavic
On Tue, Jul 19, 2016 at 12:29 PM, Amlaan Kar 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 a

[users@httpd] Use an Apache handler after declining another

2016-07-19 Thread Amlaan Kar
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 us