From 43a1396988e25f6555420fe015baae3fb24a17d1 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 3 Feb 2017 17:32:32 +0000 Subject: [PATCH] mod_ssl: don't depend on the next output filters to cleanup the passed out 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 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index fc2afda8b0..770fd4e3b6 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -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. */ -- 2.40.0