cvs: php4 /sapi/apache/ mod_php4.c

From: Date: Sun, 14 May 2000 16:05:25 +0000
Subject: cvs: php4 /sapi/apache/ mod_php4.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-15006@lists.php.net to get a copy of this message
zeev Sun May 14 18:05:25 2000 EDT Modified files: /php4/sapi/apache mod_php4.c Log: - Fix a crash bug in case output is generated in the Apache module while in request_shutdown Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.46 php4/sapi/apache/mod_php4.c:1.47 --- php4/sapi/apache/mod_php4.c:1.46 Thu May 4 05:28:34 2000 +++ php4/sapi/apache/mod_php4.c Sun May 14 18:05:25 2000 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php4.c,v 1.46 2000/05/04 03:28:34 shane Exp $ */ +/* $Id: mod_php4.c,v 1.47 2000/05/14 16:05:25 zeev Exp $ */ #define NO_REGEX_EXTRA_H #ifdef WIN32 @@ -140,7 +140,7 @@ if (SG(server_context)) { ret = rwrite(str, str_length, (request_rec *) SG(server_context)); } else { - ret = fwrite(str, 1, str_length, stdout); + ret = fwrite(str, 1, str_length, stderr); } if(ret != str_length) { PG(connection_status) = PHP_CONNECTION_ABORTED; @@ -289,6 +289,15 @@ } +static void php_apache_request_shutdown(void *dummy) +{ + SLS_FETCH(); + + SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */ + php_request_shutdown(dummy); +} + + static int php_apache_sapi_activate(SLS_D) { /* @@ -300,7 +309,7 @@ * memory. */ block_alarms(); - register_cleanup(((request_rec *) SG(server_context))->pool, NULL, php_request_shutdown, php_request_shutdown_for_exec); + register_cleanup(((request_rec *) SG(server_context))->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); unblock_alarms(); return SUCCESS; }

« previous php.version4 (#15006) next »