Re: Intercepting HTTP 301/302 redirects

2012-02-29 Thread Swaminathan Bhaskar
Thanks for the quick response Joe. Just to make sure, here is what I did: SetOutputFilter myfilter and the code #include #include #include #include #include #define MY_FILTER_NAME "myfilter" static int my_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) { fprintf(std

Re: Intercepting HTTP 301/302 redirects

2012-02-29 Thread Joe Lewis
On 02/29/2012 06:01 PM, Swaminathan Bhaskar wrote: Hi Is there anyway to intercept HTTP 301/302 redirects ? I tried registering a very simple output filter (AP_FTYPE_RESOURCE) and the filter function did not get a callback. I would assume all output goes through the filter chain Rgds Bhaska

Intercepting HTTP 301/302 redirects

2012-02-29 Thread Swaminathan Bhaskar
Hi Is there anyway to intercept HTTP 301/302 redirects ? I tried registering a very simple output filter (AP_FTYPE_RESOURCE) and the filter function did not get a callback. I would assume all output goes through the filter chain Rgds Bhaskar

Re: one problem when calling ap_get_module_config

2012-02-29 Thread Nick Kew
On 29 Feb 2012, at 10:47, Rui Hu wrote: > I use r->request_config to store module data as a substitute for global > vars. One type_checker_hook function uses ap_get_module_config at its > beginning. But what I got is NULL. Strangely, post_read_request_hook > function works fine, whose codes is ba

Re: Threads and signals in a module

2012-02-29 Thread Sorin Manolache
On 2012-02-28 22:05, Ben Rockefeller wrote: Hello, I have a module which creates a thread using pthread_create and then registers for SIGRTMIN+4 signal from another process. Problem is I do not see a signal callback when the signal is sent to me. I only see it when I try to kill apache where jus

one problem when calling ap_get_module_config

2012-02-29 Thread Rui Hu
I use r->request_config to store module data as a substitute for global vars. One type_checker_hook function uses ap_get_module_config at its beginning. But what I got is NULL. Strangely, post_read_request_hook function works fine, whose codes is basically the same. Is there any caution in calling

Re: about setting r->headers_out

2012-02-29 Thread Rui Hu
Thanks! I tried to hook "handler" and it works well. Rui Hu 2012/2/29 Sorin Manolache > On 02/29/12 07:52, Rui Hu wrote: > >> hi, >> >> I want to set "Content-Type" and "Cache-Control" fields in my private >> module. So I hooked fixups and used apr_table_setn to set >> r->headers_out but nothi

Re: about setting r->headers_out

2012-02-29 Thread Sorin Manolache
On 02/29/12 07:52, Rui Hu wrote: hi, I want to set "Content-Type" and "Cache-Control" fields in my private module. So I hooked fixups and used apr_table_setn to set r->headers_out but nothing happened. Was it thought through? Thanks for you help! Try to set r->err_headers_out. For content-ty