RE: [PATCH]apache_register_shutdown_function final version

From: Date: Mon, 30 Dec 2002 18:57:20 +0000
Subject: RE: [PATCH]apache_register_shutdown_function final version
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-92984@lists.php.net to get a copy of this message
Try looking at php_apache_request_shutdown() in mod_php4.c. It's our pool destructor. Zeev At 20:55 30/12/2002, Joseph Tate wrote:
There probably is a better way to do it. I just haven't been able to figure it out. Most Apache modules wait until the logging stage to execute "offline" code, but it doesn't seem that at that stage PHP code is still in memory. Thus there doesn't seem to be a satisfactory way to do this. As for explicitly closing the connection, I call flush before I do that, and everything that PHP cares about has been done, except for garbage_collecting and unloading itself. Apache goes ahead and cleans up everything else after the logging stage. I haven't tried explicitly with a Connection-Type: Keep-Alive, but I don't think it will cause browsers to crash. I've tested with IE 6x and Mozilla 1.2.1. My implementation was based on code existing in the apache sources (just not externally available in Apache 1.3.x) "lingering_close" and much discussion on the Apache-Modules mailing list. If you can point me to a place in PHP land where the Apache process has closed the connection, and the script is still in memory, I'll be happy to make it neater, but in my search (I spent a day or so looking for such a place) I couldn't find anything. Another interesting thing to note is that the Patch that worked with 4.1.x to restore the functionality doesn't work with 4.2 or 4.3, so something has changed so that all resource pool cleanup is happening before the connection is closed rather than after, causing PHP to appear slower than it needs to. Joseph -----Original Message----- From: Zeev Suraski [mailto:zeev@zend.com] Sent: Monday, December 30, 2002 12:55 PM That's a bit of an odd way to implement it - are you sure closing the link explicitly at that point won't interfere with anything? In 4.1 (or whatever the last version it worked like that was), it was taking advantage of the fact PHP's resource pool was being destroyed after the link was already closed. It sounds a bit risky to me to close the link explicitly at this point, even though I'm not currently aware of any immediate problem this may cause (maybe it would ruin keep-alive?) Zeev


« previous php.dev (#92984) next »