]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* modules/ssl/ssl_engine_io.c: (ssl_io_filter_coalesce): Handle the
authorJoe Orton <jorton@apache.org>
Mon, 30 Mar 2020 13:18:29 +0000 (13:18 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 30 Mar 2020 13:18:29 +0000 (13:18 +0000)
  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

modules/ssl/ssl_engine_io.c

index 997df897289e350e664f4f617830e88620eaec5c..db3b24e2a7888797579aa224e348a0fd6c4b9dd9 100644 (file)
@@ -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 "