]> granicus.if.org Git - php/commitdiff
Fixed bug #35278 (Multiple virtual() calls crash Apache 2 php module).
authorIlia Alshanetsky <iliaa@php.net>
Fri, 18 Nov 2005 18:59:49 +0000 (18:59 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 18 Nov 2005 18:59:49 +0000 (18:59 +0000)
NEWS
sapi/apache2handler/sapi_apache2.c

diff --git a/NEWS b/NEWS
index c5d2a224d715d809640991f8b3e442af40952f73..bdd319706c995966aeae60ad934f6405c3dfec59 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Nov 2005, PHP 5.1
+- Fixed bug #35278 (Multiple virtual() calls crash Apache 2 php module). (Ilia)
 - Fixed bug #35273 (Error in mapping soap - java types). (Dmitry)
 
 17 Nov 2005, PHP 5.1 Release Candidate 6
index d74ff58730bd2848134061d93a0208059cd77d68..354e2b9c600e6fc681dbed07b776b3c827cd64fd 100644 (file)
@@ -443,6 +443,18 @@ static void php_apache_request_dtor(request_rec *r TSRMLS_DC)
        php_request_shutdown(NULL);
 }
 
+static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC)
+{
+       if (strcmp(r->protocol, "INCLUDED")) {
+               zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try();
+       }
+       if (p) {
+               ((php_struct *)SG(server_context))->r = p;
+       } else {
+               apr_pool_cleanup_run(r->pool, (void *)&SG(server_context), php_server_context_cleanup);
+       }
+}
+
 static int php_handler(request_rec *r)
 {
        php_struct *ctx;
@@ -453,11 +465,7 @@ static int php_handler(request_rec *r)
        request_rec *parent_req = NULL;
        TSRMLS_FETCH();
 
-#define PHPAP_INI_OFF \
-       if (strcmp(r->protocol, "INCLUDED")) { \
-               zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); \
-       } \
-       apr_pool_cleanup_run(r->pool, (void *)&SG(server_context), php_server_context_cleanup); \
+#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC);
 
        conf = ap_get_module_config(r->per_dir_config, &php5_module);