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

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);