]> granicus.if.org Git - apache/commitdiff
mod_xml2enc: follow up to r1829038 and r1829039.
authorYann Ylavic <ylavic@apache.org>
Sun, 29 Apr 2018 22:11:04 +0000 (22:11 +0000)
committerYann Ylavic <ylavic@apache.org>
Sun, 29 Apr 2018 22:11:04 +0000 (22:11 +0000)
Use below pending_data logic for EOS bucket.
This closes #48

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

modules/filters/mod_xml2enc.c

index be07237d901f31fb2101ec637675b0507c73addd..2d7daecc90b7fe543e2adc4e6eb82e487c7872d5 100644 (file)
@@ -397,24 +397,21 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, apr_bucket_brigade* bb)
     /* move the data back to bb */
     APR_BRIGADE_CONCAT(bb, ctx->bbsave);
 
-    while (b = APR_BRIGADE_FIRST(bb), b != APR_BRIGADE_SENTINEL(bb)) {
+    while (!APR_BRIGADE_EMPTY(bb)) {
+        b = APR_BRIGADE_FIRST(bb);
         ctx->bytes = 0;
         if (APR_BUCKET_IS_METADATA(b)) {
             APR_BUCKET_REMOVE(b);
             APR_BRIGADE_INSERT_TAIL(ctx->bbnext, b);
-            /* This resource filter is over on EOS */
+            /* Besides FLUSH, aggregate meta buckets to send them at
+             * once below. This resource filter is over on EOS.
+             */
+            pending_meta = 1;
             if (APR_BUCKET_IS_EOS(b)) {
                 ap_remove_output_filter(f);
                 APR_BRIGADE_CONCAT(ctx->bbnext, bb);
-                rv = ap_pass_brigade(f->next, ctx->bbnext);
-                apr_brigade_cleanup(ctx->bbnext);
-                return rv;
             }
-            /* Besides FLUSH, aggregate meta buckets to send
-             * them at once below.
-             */
-            pending_meta = 1;
-            if (!APR_BUCKET_IS_FLUSH(b)) {
+            else if (!APR_BUCKET_IS_FLUSH(b)) {
                 continue;
             }
         }