From: Willy Tarreau Date: Wed, 19 Dec 2012 17:01:02 +0000 (+0100) Subject: BUG/MEDIUM: stream_interface: fix another case where the reader might not be woken up X-Git-Tag: v1.5-dev16~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34ac5665d4f01496e298ef771efaaccd2c41a20d;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stream_interface: fix another case where the reader might not be woken up 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. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 7e525a9d79..ecd7e4c6b7 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -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; }