]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream-int: always clear CS_FL_WANT_ROOM before receiving
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Dec 2018 08:15:43 +0000 (09:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Dec 2018 09:34:26 +0000 (10:34 +0100)
Commit d94f877cd ("BUG/MINOR: mux_pt: Set CS_FL_WANT_ROOM when count is
zero in rcv_buf() callback") triggered a pending issue with this flag,
which is that it's cleared too late and sometimes causes some Rx
transfers to stall. We need to clear it before attempting to receive
otherwise we may risk to see an earlier copy of the flag.

Note that it should probably be defined that this flag could be purged
on each invocation of mux->rcv_buf(), which would make sense.

No backport is needed.

src/stream_interface.c

index ae9a76f744a5f044e290659b14d2ab2c57a32469..6eb03be18595d2b4d0738a13a5d102c5f3e3bb43 100644 (file)
@@ -1116,6 +1116,9 @@ int si_cs_recv(struct conn_stream *cs)
                        return 1; // We want to make sure si_cs_wake() is called, so that process_strema is woken up, on failure
        }
 
+       /* prepare to detect if the mux needs more room */
+       cs->flags &= ~CS_FL_WANT_ROOM;
+
        if ((ic->flags & (CF_STREAMER | CF_STREAMER_FAST)) && !co_data(ic) &&
            global.tune.idle_timer &&
            (unsigned short)(now_ms - ic->last_read) >= global.tune.idle_timer) {