From: Ruediger Pluem Date: Tue, 9 Sep 2008 19:58:12 +0000 (+0000) Subject: * Use send_bucket_downstream to send data down the chain instead of creating X-Git-Tag: 2.3.0~310 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f8233d3f2276e86359278f83c1eb34637eee1f6;p=apache * Use send_bucket_downstream to send data down the chain instead of creating a brigade each time. PR: 45687 Submitted by: Dan Poirier Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693577 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 46935c276a..e3f99708b0 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) mod_charset_lite: Avoid dropping error responses by handling meta buckets + correctly. PR 45687 [Dan Poirier ] + *) mod_authnz_ldap: don't return NULL-valued environment variables to other modules. PR 39045 [Francois Pesce ] diff --git a/modules/filters/mod_charset_lite.c b/modules/filters/mod_charset_lite.c index f4094c9494..71045490d2 100644 --- a/modules/filters/mod_charset_lite.c +++ b/modules/filters/mod_charset_lite.c @@ -376,6 +376,20 @@ static void xlate_insert_filter(request_rec *r) * will be generated */ +static apr_status_t send_bucket_downstream(ap_filter_t *f, apr_bucket *b) +{ + charset_filter_ctx_t *ctx = f->ctx; + apr_status_t rv; + + APR_BRIGADE_INSERT_TAIL(ctx->tmpbb, b); + rv = ap_pass_brigade(f->next, ctx->tmpbb); + if (rv != APR_SUCCESS) { + ctx->ees = EES_DOWNSTREAM; + } + apr_brigade_cleanup(ctx->tmpbb); + return rv; +} + /* send_downstream() is passed the translated data; it puts it in a single- * bucket brigade and passes the brigade to the next filter */ @@ -383,19 +397,10 @@ static apr_status_t send_downstream(ap_filter_t *f, const char *tmp, apr_size_t { request_rec *r = f->r; conn_rec *c = r->connection; - apr_bucket_brigade *bb; apr_bucket *b; - charset_filter_ctx_t *ctx = f->ctx; - apr_status_t rv; - bb = apr_brigade_create(r->pool, c->bucket_alloc); b = apr_bucket_transient_create(tmp, len, c->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(bb, b); - rv = ap_pass_brigade(f->next, bb); - if (rv != APR_SUCCESS) { - ctx->ees = EES_DOWNSTREAM; - } - return rv; + return send_bucket_downstream(f, b); } static apr_status_t send_eos(ap_filter_t *f) @@ -417,20 +422,6 @@ static apr_status_t send_eos(ap_filter_t *f) return rv; } -static apr_status_t send_bucket_downstream(ap_filter_t *f, apr_bucket *b) -{ - charset_filter_ctx_t *ctx = f->ctx; - apr_status_t rv; - - APR_BRIGADE_INSERT_TAIL(ctx->tmpbb, b); - rv = ap_pass_brigade(f->next, ctx->tmpbb); - if (rv != APR_SUCCESS) { - ctx->ees = EES_DOWNSTREAM; - } - apr_brigade_cleanup(ctx->tmpbb); - return rv; -} - static apr_status_t set_aside_partial_char(charset_filter_ctx_t *ctx, const char *partial, apr_size_t partial_len)