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

From: Date: Thu, 24 Jan 2002 18:01:20 +0000
Subject: Bug #15209: Under Apache, register_shutdown_function() broke between 4.0.x to 4.1.x
Groups: php.dev 
Request: Send a blank email to php-dev+get-78019@lists.php.net to get a copy of this message
From: priebe@mi-corporation.com Operating system: RH Linux 7.2 PHP version: 4.1.1 PHP Bug Type: Output Control Bug description: Under Apache, register_shutdown_function() broke between 4.0.x to 4.1.x 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 bug report at: http://bugs.php.net/?id=15209&edit=1

« previous php.dev (#78019) next »