summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2001-05-13 09:07:02 +0000
committerZeev Suraski <zeev@php.net>2001-05-13 09:07:02 +0000
commita522511289356d9fd89238e1fb247e83ce0ca184 (patch)
tree34dbaa28084c205677aeb6aa12586f45a8134f21
parent06c41c0a0fc255514256caf2876b0d8e4ca11c58 (diff)
downloadphp-git-a522511289356d9fd89238e1fb247e83ce0ca184.tar.gz
MFH
-rw-r--r--sapi/apache/mod_php4.c5
-rw-r--r--sapi/apache/mod_php4.h1
-rw-r--r--sapi/apache/php_apache.c11
3 files changed, 15 insertions, 2 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 13af96edee..e713b1409a 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -285,7 +285,9 @@ static void php_apache_log_message(char *message)
static void php_apache_request_shutdown(void *dummy)
{
SLS_FETCH();
+ APLS_FETCH();
+ AP(in_request)=0;
SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
php_request_shutdown(dummy);
}
@@ -446,7 +448,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
PLS_FETCH();
APLS_FETCH();
- if (r->assbackwards && r->protocol && !strcmp(r->protocol, "INCLUDED")) {
+ if (AP(in_request)) {
zend_file_handle fh;
fh.filename = r->filename;
@@ -456,6 +458,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
zend_execute_scripts(ZEND_INCLUDE CLS_CC ELS_CC, 1, &fh);
return OK;
}
+ AP(in_request)=1;
if (setjmp(EG(bailout))!=0) {
return OK;
diff --git a/sapi/apache/mod_php4.h b/sapi/apache/mod_php4.h
index f3fcc143e3..c70d09a5a8 100644
--- a/sapi/apache/mod_php4.h
+++ b/sapi/apache/mod_php4.h
@@ -31,6 +31,7 @@ typedef struct {
long last_modified;
long xbithack;
long terminate_child;
+ zend_bool in_request;
} php_apache_info_struct;
extern zend_module_entry apache_module_entry;
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 2ae7dca282..9a055d76a3 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -89,10 +89,19 @@ PHP_INI_BEGIN()
PHP_INI_END()
+
+static void php_apache_globals_ctor(php_apache_info_struct *apache_globals)
+{
+ apache_globals->in_request = 0;
+}
+
+
static PHP_MINIT_FUNCTION(apache)
{
#ifdef ZTS
- php_apache_info_id = ts_allocate_id(sizeof(php_apache_info_struct), NULL, NULL);
+ php_apache_info_id = ts_allocate_id(sizeof(php_apache_info_struct), ts_allocate_ctor, NULL);
+#else
+ php_apache_globals_ctor(&php_apache_info);
#endif
REGISTER_INI_ENTRIES();
return SUCCESS;