httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject Re: [PATCH] post_connection hook
Date Thu, 14 Nov 2002 17:25:44 GMT
At 03:36 AM 11/14/2002, James Ponder wrote:
>On Wed, Nov 13, 2002 at 08:43:05PM -0500, Jeff Trawick wrote:
>> The recommended approach is to register a cleanup with the conn_rec
>> pool.  When the connection goes away, so does the conn_rec pool, and
>> your cleanup will then run.
>Does that place any restrictions on what can be done in the cleanup code,
>for example is there any memory that might have vanished as I'm trying to
>do things?  (I can't actually think what I may want to do on a connection
>close apart from use the IP/socket information - presumably that's at least
>still available)

Cleanups are a LIFO stack.  When a pool is freed, first all sub-pools are
freed.  Then all cleanups within that pool are run (the cleanups in the
sub-pool already ran when those sub-pools were freed.)

So if you register a cleanup, then create an apr object in the same pool,
those apr object's cleanup runs before your registered cleanup.

If you create an apr object and register your own cleanup, you still have
that object until your registered cleanup is finished.


View raw message