]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stconn: Fix streamer detection for HTX streams
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Nov 2023 10:23:11 +0000 (11:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Nov 2023 14:09:17 +0000 (15:09 +0100)
Since the HTX was introduced, the streamer detection is broken for HTX
streams because the HTX overhead was not counted in the test to set
CF_STREAMER and CF_STREAMER_FAST flags.

The consequence was that the consumer side was no longer able to send more
than tune.ssl.maxrecord at a time in SSL.

To fix the issue, we now count the HTX overhead of HTX streams to be able to
set CF_STREAMER/CF_STREAMER_FAST flags on a channel.

This patch relies on folloing commits:

  * "MINOR: channel: Add functions to get info on buffers and deal with HTX streams"
  * "MINOR: htx: Use a macro for overhead induced by HTX"

The series must be backported as far as 2.2.

src/stconn.c

index f8eb4ae03d03c1efe99890a627b701570a8ceaad..e7ed6a7ae1f7bc6cbd26e0cf31fef69bbc1f9ab5 100644 (file)
@@ -1463,8 +1463,7 @@ static int sc_conn_recv(struct stconn *sc)
                                ic->flags &= ~CF_STREAMER_FAST;
                        }
                }
-               else if (!(ic->flags & CF_STREAMER_FAST) &&
-                        (cur_read >= ic->buf.size - global.tune.maxrewrite)) {
+               else if (!(ic->flags & CF_STREAMER_FAST) && (cur_read >= channel_data_limit(ic))) {
                        /* we read a full buffer at once */
                        ic->xfer_small = 0;
                        ic->xfer_large++;