external redirect

2009-01-23 Thread fka...@googlemail.com
Hi, I'd like to do an external redirect. When I return HTTP_MOVED_TEMPORARILY from my request handler, the client browser gets the standard "FOUND" message which is ok so far. However, when I also try to set the new "Location" this always causes a segmentation fault: char* uri=apr_pstrdup(r->po

Re: external redirect

2009-01-23 Thread fka...@googlemail.com
Peter Poeml: > It should work just like that. In which line does the > crash precisely happen? In my code (see below) it is triggered if I try to set the apr_table_t and *then* return. When returning *only* there is no seg fault. Please see the comments in the code. It must be something trivial.

Re: external redirect

2009-01-23 Thread fka...@googlemail.com
Peter Poeml: > I built the module from that source and it works for me. > It doesn't crash. Thank you so much for testing it. > gdb --args /usr/sbin/httpd2-prefork -f > /etc/apache2/httpd.conf -DONE_PROCESS -DNO_DETACH That was also helpful. I got some pointers to libc and some syscalls to the

multiple processes: but one module init needed

2009-01-25 Thread fka...@googlemail.com
Hi all, some of the initialization tasks of my module must not be done repeatedly with each spawned server process. Currently I init my module by ap_hook_child_init() and do cleaning up by apr_pool_cleanup_register(), so each spawned server process inits my module again. Do I have to do IPC betw

Re: multiple processes: but one module init needed

2009-01-25 Thread fka...@googlemail.com
Saju Pillai: > [email protected] wrote: > > Hi all, > > > > some of the initialization tasks of my module must not be > > done repeatedly with each spawned server process. > > > The post_config hook may help you. Thanks -- but in what way? Even with

Re: multiple processes: but one module init needed

2009-01-25 Thread fka...@googlemail.com
[email protected]: > some of the initialization tasks of my module must not be > done repeatedly with each spawned server process. To be more precise: There is only *one* vhost/configuration here, however, due to the mpm settings (see below) apache launches *several* processes to se

Re: multiple processes: but one module init needed

2009-01-25 Thread fka...@googlemail.com
Saju Pillai: > Look at http://wiki.apache.org/httpd/ModuleLife to see > how to make init code run only once from post_config How cool. That explains everything... Thank You!! Felix