MINOR: connection: add flag CO_FL_WILL_UPDATE to indicate when updates are granted
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2017 07:22:43 +0000 (09:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2017 13:52:41 +0000 (15:52 +0200)
commit916e12dcfbee0d66f2ac04f7c033b6946d71bfe2
treeb9e2d3f5502f0794f196a838913a5759ca0d4048
parentbc97cc4fd14972d68e20f6b6031c30b872aeb8e6
MINOR: connection: add flag CO_FL_WILL_UPDATE to indicate when updates are granted

In transport-layer functions (snd_buf/rcv_buf), it's very problematic
never to know if polling changes made to the connection will be propagated
or not. This has led to some conn_cond_update_polling() calls being placed
at a few places to cover both the cases where the function is called from
the upper layer and when it's called from the lower layer. With the arrival
of the MUX, this becomes even more complicated, as the upper layer will not
have to manipulate anything from the connection layer directly and will not
have to push such updates directly either. But the snd_buf functions will
need to see their updates committed when called from upper layers.

The solution here is to introduce a connection flag set by the connection
handler (and possibly any other similar place) indicating that the caller
is committed to applying such changes on return. This way, the called
functions will be able to apply such changes by themselves before leaving
when the flag is not set, and the upper layer will not have to care about
that anymore.
include/proto/connection.h
include/types/connection.h
src/connection.c