summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bannert <aaron@php.net>2002-04-11 17:34:17 +0000
committerAaron Bannert <aaron@php.net>2002-04-11 17:34:17 +0000
commitcaf7f3d4d20a198e90a932d139f7a3edf6081ae5 (patch)
tree0d7bf38a4b8a3cdde3f3baccd8dc35db0a58a2af
parentd19fd6a0ad4e776df46607c3fe4611a0728f12c1 (diff)
downloadphp-git-caf7f3d4d20a198e90a932d139f7a3edf6081ae5.tar.gz
Don't depend on the context provided by the filter (f->ctx) anymore. In
Apache 2 the input and output filter contexts are kept unique. We now only depend on SG(server_context) for each request, and assume that the same thread will process the entire request. At some point it would be wise to separate the input and output contexts.
-rw-r--r--sapi/apache2filter/sapi_apache2.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index d44fed1b56..f0d3b6d4cf 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -252,9 +252,7 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
return ap_get_brigade(f->next, bb, mode, block, readbytes);
}
- ctx = SG(server_context);
-
- if (ctx == NULL) {
+ if (SG(server_context) == NULL) {
/* Initialize filter context */
SG(server_context) = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
}
@@ -330,9 +328,9 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
ap_add_common_vars(f->r);
ap_add_cgi_vars(f->r);
- if (f->ctx == NULL) {
+ if (SG(server_context) == NULL) {
/* Initialize filter context */
- f->ctx = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
+ SG(server_context) = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
ctx->f = f;
}
@@ -365,7 +363,6 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
}
}
- SG(server_context) = ctx;
apply_config(conf);
php_apache_request_ctor(f, ctx TSRMLS_CC);