summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch')
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch b/dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch
new file mode 100644
index 0000000..49f5c95
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch
@@ -0,0 +1,51 @@
+--- sapi/apache2handler/sapi_apache2.c 2005-10-12 23:41:36.000000000 +0200
++++ sapi/apache2handler/sapi_apache2.c 2005-11-18 21:19:33.000000000 +0100
+@@ -18,7 +18,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: sapi_apache2.c,v 1.1.2.40.2.5 2005/10/12 21:41:36 tony2001 Exp $ */
++/* $Id: sapi_apache2.c,v 1.1.2.40.2.8 2005/11/18 19:03:13 iliaa Exp $ */
+
+ #include <fcntl.h>
+
+@@ -443,6 +443,18 @@
+ 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,10 +465,7 @@
+ 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(); \
+- } \
++#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC);
+
+ conf = ap_get_module_config(r->per_dir_config, &php4_module);
+
+@@ -535,7 +544,7 @@
+ if (!parent_req) {
+ parent_req = ctx->r;
+ }
+- if (parent_req && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) {
++ if (parent_req && parent_req->handler && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) {
+ if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) {
+ zend_bailout();
+ }