httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: SIGPIPE on Solaris 2.5.1
Date Tue, 22 Apr 1997 23:57:01 GMT
On Tue, 22 Apr 1997 wrote:

> Now that we are on this topic, might it be possible to define a module 
> cleanup function for Apache modules?  Looking at the code, it seems like
> this should be done from the timeout() function in http_main.c.
> I am currently manageing my own file descriptors.  I should probably be
> using the popen functions from alloc.c, but the various SQL engines that
> mod_php can talk to prefer to have their various close connection functions
> called as well instead of just shutting down the sockets.  
> I might solve this by making my Exit function the SIG_PIPE handler and then
> in turn having my Exit function call Apache's timeout function.  I don't
> think this can be done for SIGALRM nor SIGURG though.  It seems like a good
> way to solve it would be to let modules define an optional exit/cleanup
> function.
> Am I off my rocker here?  Have I missed an obvious solution?

I'm not sure exactly what you want to do, but you can certainly use
register_cleanup() to add a cleanup function to any given memory
pool, like r->pool, r->connection->pool, whatever. That's how popen()
and related functions manage it, so if you're trying to achieve that
sort of effect, that'd be the perferred method.

I'm not quire sure what "cleanup function for Apache Modules" means
precisely, though. Modules are created at startup, and are not
destroyed until the server is killed or started, but I don't think
that's what you're reffering to.

Alexei Kosut <>      The Apache HTTP Server

View raw message