summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bannert <aaron@php.net>2002-04-11 20:34:56 +0000
committerAaron Bannert <aaron@php.net>2002-04-11 20:34:56 +0000
commit22fb507325ac13a26f1b443f098f6f9764189001 (patch)
tree7ba4f0ee53327f3bd1205d2d76405f642c4f485b
parent6f22159aa22f9aac58efc86699938ec42a319041 (diff)
downloadphp-git-22fb507325ac13a26f1b443f098f6f9764189001.tar.gz
Fix a problem where php-generated data was pushed down the entire output
filter chain instead of just down the rest of the chain. This fix will speed up some unnecessary overhead introduced in the last patch. Suggested by: Cliff Woolley <jwoolley@apache.org>
-rw-r--r--sapi/apache2filter/php_apache.h1
-rw-r--r--sapi/apache2filter/sapi_apache2.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h
index cc60ad2293..8cac0a0e37 100644
--- a/sapi/apache2filter/php_apache.h
+++ b/sapi/apache2filter/php_apache.h
@@ -22,6 +22,7 @@
typedef struct php_struct {
int state;
request_rec *r;
+ ap_filter_t *f; /* downstream output filters after the PHP filter. */
/* Length of post_data buffer */
int post_len;
/* Index for reading from buffer */
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 6b44c7ec1d..986de019f2 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -49,11 +49,11 @@ php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
apr_bucket *b;
apr_bucket_brigade *bb;
apr_bucket_alloc_t *ba;
- ap_filter_t *f; /* output filters */
+ ap_filter_t *f; /* remaining output filters */
php_struct *ctx;
ctx = SG(server_context);
- f = ctx->r->output_filters;
+ f = ctx->f;
if (str_length == 0) return 0;
@@ -183,7 +183,7 @@ php_apache_sapi_flush(void *server_context)
if (!server_context)
return;
- f = ctx->r->output_filters;
+ f = ctx->f;
/* Send a flush bucket down the filter chain. The current default
* handler seems to act on the first flush bucket, but ignores
@@ -344,6 +344,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
ap_add_cgi_vars(f->r);
ctx = SG(server_context);
+ ctx->f = f; /* safe whatever filters are after us in the chain. */
if (ctx == NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, f->r,
"php failed to get server context");