cvs: php4 /main SAPI.h /sapi/apache2 mod_php4.c
| From: | Rasmus Lerdorf | Date: | Mon, 23 Oct 2000 00:52:11 +0000 |
| Subject: | cvs: php4 /main SAPI.h /sapi/apache2 mod_php4.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2236@lists.php.net to get a copy of this message | ||
rasmus Sun Oct 22 17:52:11 2000 EDT
Modified files:
/php4/main SAPI.h
/php4/sapi/apache2 mod_php4.c
Log:
Move server_filter to an extension-specific global
Index: php4/main/SAPI.h
diff -u php4/main/SAPI.h:1.56 php4/main/SAPI.h:1.57
--- php4/main/SAPI.h:1.56 Sun Oct 22 12:50:05 2000
+++ php4/main/SAPI.h Sun Oct 22 17:52:11 2000
@@ -102,7 +102,6 @@
char *default_charset;
HashTable *rfc1867_uploaded_files;
long post_max_size;
- void *server_filter;
} sapi_globals_struct;
Index: php4/sapi/apache2/mod_php4.c
diff -u php4/sapi/apache2/mod_php4.c:1.3 php4/sapi/apache2/mod_php4.c:1.4
--- php4/sapi/apache2/mod_php4.c:1.3 Sun Oct 22 09:56:08 2000
+++ php4/sapi/apache2/mod_php4.c Sun Oct 22 17:52:11 2000
@@ -15,7 +15,7 @@
| Authors: |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php4.c,v 1.3 2000/10/22 16:56:08 rasmus Exp $ */
+/* $Id: mod_php4.c,v 1.4 2000/10/23 00:52:11 rasmus Exp $ */
#define NO_REGEX_EXTRA_H
#ifdef WIN32
@@ -91,6 +91,15 @@
int saved_umask;
static unsigned char apache_php_initialized;
+/* per-thread globals (when the ZTS stuff gets added) */
+typedef struct {
+ ap_filter_t *server_filter;
+} php_ap_globals_struct;
+
+/* Needs to be per-thread when in threaded mode (per-server for now in pre-fork
+ * mode) */
+static php_ap_globals_struct *php_ap_globals;
+
typedef struct _php_per_dir_entry {
char *key;
char *value;
@@ -122,7 +131,7 @@
bb = ap_brigade_create(r->pool);
b = ap_bucket_create_immortal(str, str_length);
AP_BRIGADE_INSERT_TAIL(bb, b);
- ap_pass_brigade(SG(server_filter)->next, bb);
+ ap_pass_brigade((php_ap_globals->server_filter)->next, bb);
} else {
ret = fwrite(str, 1, str_length, stderr);
}
@@ -714,7 +723,8 @@
if (ctx == NULL) {
f->ctx = ctx = apr_pcalloc(c->pool, sizeof(php_output_filter_ctx_t));
ctx->b = ap_brigade_create(c->pool); /* create an initial empty brigade */
- SG(server_filter) = f;
+ php_ap_globals = palloc(sizeof *php_ap_globals);
+ php_ap_globals->server_filter = f;
}
ap_save_brigade(f, ctx->bb, bb);