]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_ssl: release coalesced data when called from ap_filter_output_pending().
authorYann Ylavic <ylavic@apache.org>
Wed, 1 Jul 2020 23:16:04 +0000 (23:16 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 1 Jul 2020 23:16:04 +0000 (23:16 +0000)
The purpose of ap_filter_output_pending() is to flush pending data, so
ssl_io_filter_coalesce() should honor that.

This allows mod_proxy to not care about mod_ssl coalescing filters when
tunneling between connections.

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

modules/proxy/proxy_util.c
modules/ssl/ssl_engine_io.c

index 8b99c5f8d2ff5871fb7d1ee9a09f5d7ab61ee02b..7695817dcb536dbd36feb0f8b814b071d198fc06 100644 (file)
@@ -4327,12 +4327,6 @@ PROXY_DECLARE(apr_status_t) ap_proxy_tunnel_create(proxy_tunnel_rec **ptunnel,
     apr_socket_opt_set(tunnel->client->pfd->desc.s, APR_SO_NONBLOCK, 1);
     apr_socket_opt_set(tunnel->origin->pfd->desc.s, APR_SO_NONBLOCK, 1);
 
-    /* No coalescing filters */
-    ap_remove_output_filter_byhandle(c_i->output_filters,
-                                     "SSL/TLS Coalescing Filter");
-    ap_remove_output_filter_byhandle(c_o->output_filters,
-                                     "SSL/TLS Coalescing Filter");
-
     /* Bidirectional non-HTTP stream will confuse mod_reqtimeoout */
     ap_remove_input_filter_byhandle(c_i->input_filters, "reqtimeout");
 
index 4bcf5e9dec4f49827d73e1d72649d09b47858dcd..9ea36a5658cf8b4b5dc327899ba1eb57c0d03e85 100644 (file)
@@ -1715,6 +1715,20 @@ static apr_status_t ssl_io_filter_coalesce(ap_filter_t *f,
     apr_size_t buffered = ctx ? ctx->bytes : 0; /* space used on entry */
     unsigned count = 0;
 
+    /* Pass down everything if called from ap_filter_output_pending() */
+    if (APR_BRIGADE_EMPTY(bb)) {
+        if (!ctx || !ctx->bytes) {
+            return APR_SUCCESS;
+        }
+
+        e = apr_bucket_transient_create(ctx->buffer, ctx->bytes,
+                                        bb->bucket_alloc);
+        APR_BRIGADE_INSERT_TAIL(bb, e);
+        ctx->bytes = 0; /* buffer now emptied. */
+
+        return ap_pass_brigade(f->next, bb);
+    }
+
     /* The brigade consists of zero-or-more small data buckets which
      * can be coalesced (referred to as the "prefix"), followed by the
      * remainder of the brigade.