From: Joe Orton Date: Mon, 30 Mar 2020 13:18:29 +0000 (+0000) Subject: * modules/ssl/ssl_engine_io.c: (ssl_io_filter_coalesce): Handle the X-Git-Tag: 2.5.0-alpha2-ci-test-only~1546 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cb5515b18b543055ccef9b345cd9a74f0182018;p=thirdparty%2Fapache%2Fhttpd.git * modules/ssl/ssl_engine_io.c: (ssl_io_filter_coalesce): Handle the case of a bucket which morphs to a bucket short enough to fit within the buffer without needing to split. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1875881 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index 997df897289..db3b24e2a78 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -1749,7 +1749,17 @@ static apr_status_t ssl_io_filter_coalesce(ap_filter_t *f, } } - rv = apr_bucket_split(e, COALESCE_BYTES - (buffered + bytes)); + /* If the read above made the bucket morph, it may now fit + * entirely within the buffer. Otherwise, split it so it does + * fit. */ + if (e->length < COALESCE_BYTES + && e->length + buffered + bytes < COALESCE_BYTES) { + rv = APR_SUCCESS; + } + else { + rv = apr_bucket_split(e, COALESCE_BYTES - (buffered + bytes)); + } + if (rv == APR_SUCCESS) { ap_log_cerror(APLOG_MARK, APLOG_TRACE4, 0, f->c, "coalesce: adding %" APR_SIZE_T_FMT " bytes "