]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stream-int: make SI_FL_WANT_PUT reflect CF_DONT_READ
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Nov 2018 14:07:35 +0000 (15:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2018 09:18:37 +0000 (10:18 +0100)
commit1f9de21c38433ce24d5d5e70c594e72933d36aa4
tree3aabc951804485697e9b362c3cd596bdf3f38d0f
parent1bdb598a55fe5e0bd209459754c60008bd95f7a9
MEDIUM: stream-int: make SI_FL_WANT_PUT reflect CF_DONT_READ

When CF_DONT_READ is set, till now we used to set SI_FL_WAIT_ROOM, which
is not appropriate since it would lose the subscribe status. Instead let's
clear SI_FL_WANT_PUT (just like applets do), and set the flag only when
CF_DONT_READ is cleared.

We have to do this in stream_int_update(), and in si_cs_io_cb() after
returning from si_cs_recv() since it would be a bit invasive to hack
this one for now. It must not be done in stream_int_notify() otherwise
it would re-enable blocked applets.

Last, when si_chk_rcv() is called, it immediately clears the flag before
calling ->chk_rcv() so that we are not tempted to uselessly loop on the
same call until the receive function is called. This is the same principle
as what is done with the applet scheduler.
include/proto/stream_interface.h
src/stream_interface.c