]> granicus.if.org Git - apache/commitdiff
mod_ssl: don't depend on the next output filters to cleanup the passed out
authorYann Ylavic <ylavic@apache.org>
Fri, 3 Feb 2017 17:32:32 +0000 (17:32 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 3 Feb 2017 17:32:32 +0000 (17:32 +0000)
brigades.

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

modules/ssl/ssl_engine_io.c

index fc2afda8b0d06f765e814df229e1cdd56b565631..770fd4e3b6abd8a55767209d2e6919d14bac2854 100644 (file)
@@ -142,6 +142,7 @@ static int bio_filter_out_pass(bio_filter_out_ctx_t *outctx)
     if (outctx->rc == APR_SUCCESS && outctx->c->aborted) {
         outctx->rc = APR_ECONNRESET;
     }
+    apr_brigade_cleanup(outctx->bb);
     return (outctx->rc == APR_SUCCESS) ? 1 : -1;
 }
 
@@ -1818,18 +1819,15 @@ static apr_status_t ssl_io_filter_output(ap_filter_t *f,
                 ssl_filter_io_shutdown(filter_ctx, f->c, 0);
             }
 
-            AP_DEBUG_ASSERT(APR_BRIGADE_EMPTY(outctx->bb));
-
             /* Metadata buckets are passed one per brigade; it might
              * be more efficient (but also more complex) to use
              * outctx->bb as a true buffer and interleave these with
              * data buckets. */
             APR_BUCKET_REMOVE(bucket);
-            APR_BRIGADE_INSERT_HEAD(outctx->bb, bucket);
-            status = ap_pass_brigade(f->next, outctx->bb);
-            if (status == APR_SUCCESS && f->c->aborted)
-                status = APR_ECONNRESET;
-            apr_brigade_cleanup(outctx->bb);
+            APR_BRIGADE_INSERT_TAIL(outctx->bb, bucket);
+            if (bio_filter_out_pass(outctx) < 0) {
+                status = outctx->rc;
+            }
         }
         else {
             /* Filter a data bucket. */