From: Joe Orton Date: Thu, 5 Jul 2012 15:33:18 +0000 (+0000) Subject: * modules/filters/mod_ext_filter.c (ef_unified_filter): Set hit_eos X-Git-Tag: 2.5.0-alpha~6676 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76b780ee599ee7a8ecee4b73ab7202d8ddd7152b;p=thirdparty%2Fapache%2Fhttpd.git * modules/filters/mod_ext_filter.c (ef_unified_filter): Set hit_eos flag on hitting EOS. (ef_input_filter): Give back EOS if filter is invoked after hitting EOS, rather than attempting (and failing) to read from the closed pipe to the child. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1357685 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index bc8b9eef4b5..2fc68fb3b22 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_ext_filter: Fix error_log spam when input filters are configured. + [Joe Orton] + *) mod_rewrite: Add "AllowAnyURI" option. PR 52774. [Joe Orton] *) mod_ssl: Add RFC 5878 support. [Ben Laurie] diff --git a/modules/filters/mod_ext_filter.c b/modules/filters/mod_ext_filter.c index bbe93269f89..658c121a0ba 100644 --- a/modules/filters/mod_ext_filter.c +++ b/modules/filters/mod_ext_filter.c @@ -66,7 +66,7 @@ typedef struct ef_ctx_t { apr_procattr_t *procattr; ef_dir_t *dc; ef_filter_t *filter; - int noop; + int noop, hit_eos; #if APR_FILES_AS_SOCKETS apr_pollset_t *pollset; #endif @@ -827,6 +827,7 @@ static int ef_unified_filter(ap_filter_t *f, apr_bucket_brigade *bb) if (eos) { b = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b); + ctx->hit_eos = 1; } return APR_SUCCESS; @@ -910,6 +911,14 @@ static apr_status_t ef_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, ctx = f->ctx; } + if (ctx->hit_eos) { + /* Match behaviour of HTTP_IN if filter is re-invoked after + * hitting EOS: give back another EOS. */ + apr_bucket *e = apr_bucket_eos_create(f->c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, e); + return APR_SUCCESS; + } + if (ctx->noop) { ap_remove_input_filter(f); return ap_get_brigade(f->next, bb, mode, block, readbytes);