]> granicus.if.org Git - apache/commitdiff
mod_ssl: Avoid one TLS record (application data) fragmentation by including
authorYann Ylavic <ylavic@apache.org>
Tue, 5 Jan 2016 16:52:29 +0000 (16:52 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 5 Jan 2016 16:52:29 +0000 (16:52 +0000)
the last suitable bucket when coalescing.

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

CHANGES
modules/ssl/ssl_engine_io.c

diff --git a/CHANGES b/CHANGES
index f81104bb4af30a2527f6cc636c77aea24e787e0f..40f88076fe8355ee6545c1c1a3aff2eb9150488f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_ssl: Avoid one TLS record (application data) fragmentation by
+     including the last suitable bucket when coalescing.  [Yann Ylavic]
+
   *) mod_http2: reworked synching of session shutdown with worker threads. h2 
      workers now stick to a session until no more reuqquest are tbd, keepalive 
      handling revisited, users report problems with connection close without
index aaa5dce14b2d0e1913aaff9cfe2f05a062e02085..dc998462b084c26e1cba4ab250c5a4820b89b796 100644 (file)
@@ -1532,7 +1532,7 @@ struct coalesce_ctx {
 static apr_status_t ssl_io_filter_coalesce(ap_filter_t *f,
                                            apr_bucket_brigade *bb)
 {
-    apr_bucket *e, *last = NULL;
+    apr_bucket *e, *endb;
     apr_size_t bytes = 0;
     struct coalesce_ctx *ctx = f->ctx;
     unsigned count = 0;
@@ -1559,10 +1559,10 @@ static apr_status_t ssl_io_filter_coalesce(ap_filter_t *f,
              && (ctx == NULL
                  || bytes + ctx->bytes + e->length < COALESCE_BYTES);
          e = APR_BUCKET_NEXT(e)) {
-        last = e;
         if (e->length) count++; /* don't count zero-length buckets */
         bytes += e->length;
     }
+    endb = e;
 
     /* Coalesce the prefix, if:
      * a) more than one bucket is found to coalesce, or
@@ -1571,7 +1571,7 @@ static apr_status_t ssl_io_filter_coalesce(ap_filter_t *f,
      */
     if (bytes > 0
         && (count > 1
-            || (count == 1 && APR_BUCKET_NEXT(last) == APR_BRIGADE_SENTINEL(bb)))) {
+            || (count == 1 && endb == APR_BRIGADE_SENTINEL(bb)))) {
         /* If coalescing some bytes, ensure a context has been
          * created. */
         if (!ctx) {
@@ -1588,7 +1588,7 @@ static apr_status_t ssl_io_filter_coalesce(ap_filter_t *f,
          * normal path of sending the buffer + remaining buckets in
          * brigade.  */
         e = APR_BRIGADE_FIRST(bb);
-        while (e != last) {
+        while (e != endb) {
             apr_size_t len;
             const char *data;
             apr_bucket *next;