]> granicus.if.org Git - apache/commitdiff
* Use send_bucket_downstream to send data down the chain instead of creating
authorRuediger Pluem <rpluem@apache.org>
Tue, 9 Sep 2008 19:58:12 +0000 (19:58 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 9 Sep 2008 19:58:12 +0000 (19:58 +0000)
  a brigade each time.

PR: 45687
Submitted by: Dan Poirier <poirier pobox.com>
Reviewed by: rpluem

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693577 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/filters/mod_charset_lite.c

diff --git a/CHANGES b/CHANGES
index 46935c276ad4c08177ee6f3f2f7fdec43335913c..e3f99708b0f85f108f551b0d466336cb5721c61f 100644 (file)
--- 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 <poirier pobox.com>]
+
   *) mod_authnz_ldap: don't return NULL-valued environment variables to
      other modules.  PR 39045 [Francois Pesce <francois.pesce gmail.com>]
 
index f4094c94947f89acf1791ea4705a063c1e05bb67..71045490d22f6359b13d58ae44703a4f797a621b 100644 (file)
@@ -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)