Bug #15209 Updated: Under Apache, register_shutdown_function() broke between 4.0.x to 4.1.x

From: Date: Mon, 03 Jun 2002 13:38:28 +0000
Subject: Bug #15209 Updated: Under Apache, register_shutdown_function() broke between 4.0.x to 4.1.x
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9306@lists.php.net to get a copy of this message
ID: 15209 Updated by: mfischer@php.net Reported By: priebe@mi-corporation.com -Status: Critical +Status: Feedback Bug Type: Output Control Operating System: RH Linux 7.2 PHP Version: 4.1.1 New Comment: Can't be critical, no one else reported this yet. Please test with latest Apache/PHP and see if this problem still exists (regardless of the source in sapi_apache.c) Previous Comments: ------------------------------------------------------------------------ [2002-01-24 13:01:19] priebe@mi-corporation.com Under Apache 1.3.20 and PHP 4.1.1, register_shutdown_function() will run the specified function, but it will not close the connection to the client. I have isolated the problem to sapi/apache/sapi_apache.c. In apache_php_module_main(), php_request_shutdown() is called. When called from this location, the connection is not shut down. However, if you comment this call out (along with the AP(in_request) = 0), it will be called from php_apache_request_shutdown() instead. When called from this function, php_request_shutdown() operates as expected. I do not understand enough about why the changes were made from 4.0.x to 4.1.x. I also have not fully tested this change to see if there are undesirable side effects. I was hoping that someone more familiar with PHP internals would look at it and have an "A-HA" moment. Here is a patch (hope this survives the cut-and-paste): --- php-4.1.1/sapi/apache/sapi_apache.c Sat Aug 4 21:42:45 2001 +++ ../php-4.1.1-changed/php-4.1.1/sapi/apache/sapi_apache.c Thu Jan 24 12:08:40 2002 @@ -89,13 +89,13 @@ (void) php_execute_script(&file_handle TSRMLS_CC); } - +/* AP(in_request) = 0; zend_try { php_request_shutdown(NULL); } zend_end_try(); - +*/ return (OK); } /* }}} */ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15209&edit=1

« previous php.bugs (#9306) next »