]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stream-int: automatically release SI_FL_WAIT_DATA on SHUTW_NOW
authorWilly Tarreau <w@1wt.eu>
Tue, 13 Dec 2016 14:21:25 +0000 (15:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 14 Dec 2016 15:48:16 +0000 (16:48 +0100)
commit8cf9c8e663fa468fa2380eddecd671172ff63868
treef9662027a6c4c2e803b78f469f807d1f4bc88c36
parent5e637e556d12cd4d8b97b4896448ef6f3396224b
BUG/MINOR: stream-int: automatically release SI_FL_WAIT_DATA on SHUTW_NOW

While developing an experimental applet performing only one read per full
line, it appeared that it would be woken up for the client's close, not
read all data (missing LF), then wait for a subsequent call, and would only
be woken up on client timeout to finish the read. The reason is that we
preset SI_FL_WAIT_DATA in the stream-interface's flags to avoid a fast loop,
but there's nothing which can remove this flag until there's a read operation.

We must definitely remove it in stream_int_notify() each time we're called
with CF_SHUTW_NOW because we know there will be no more subsequent read
and we don't want an applet which keeps the WANT_GET flag to block on this.

This fix should be backported to 1.7 and 1.6 though it's uncertain whether
cli, peers, lua or spoe really are affected there.
src/stream_interface.c