]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: haterm: Fix condition to use direct data forwarding
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 May 2026 16:25:27 +0000 (18:25 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 May 2026 17:07:44 +0000 (19:07 +0200)
The direct fowarding support was only relying on "hs->to_write" value. But
we must be sure to retry if fast-forward data are still there in the I/O
buffer.

src/haterm.c

index 0c9ffe17ec77fa23a7c6a6805fa51e3b55f9842a..5a5213a0b271c2d277381940d501ec31507a31e4 100644 (file)
@@ -1047,12 +1047,9 @@ static struct task *process_hstream(struct task *t, void *context, unsigned int
                        goto err;
 
                /* TX part */
-               if (hstream_is_fastfwd_supported(hs)) {
+               if (hstream_is_fastfwd_supported(hs) || se_have_ff_data(hs->sc->sedesc)) {
                        if (!htx_is_empty(htxbuf(&hs->res)))
                                goto flush_res_buf;
-                       if (!hs->to_write && !se_have_ff_data(hs->sc->sedesc))
-                               goto out;
-
                        ret = hstream_ff_snd(conn, hs);
                        if (ret >= 0)
                                goto send_done;