]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream_interface: fix another case where the reader might not be woken up
authorWilly Tarreau <w@1wt.eu>
Wed, 19 Dec 2012 17:01:02 +0000 (18:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Dec 2012 18:28:57 +0000 (19:28 +0100)
The code review during the chase for the POST freeze uncovered another possible
issue which might appear when we perform an incomplete read and want to stop because
of READ_DONTWAIT or because we reached the maximum read_poll limit. Reading is
disabled but SI_FL_WAIT_ROOM was not set, possibly causing some cases where a
send() on the other side would not wake the reader up until another activity
on the same side calls the update function which fixes its status.

src/stream_interface.c

index 7e525a9d79bd87c4adbc52a54f04d2bae487e58b..ecd7e4c6b7185d090267be089719e566b4914dc1 100644 (file)
@@ -1037,6 +1037,7 @@ static void si_conn_recv_cb(struct connection *conn)
                }
 
                if ((chn->flags & CF_READ_DONTWAIT) || --read_poll <= 0) {
+                       si->flags |= SI_FL_WAIT_ROOM;
                        __conn_data_stop_recv(conn);
                        break;
                }