MEDIUM: stream-int: make si_update() synchronize flag changes before the I/O
authorWilly Tarreau <w@1wt.eu>
Thu, 25 Oct 2018 09:06:57 +0000 (11:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 28 Oct 2018 12:47:00 +0000 (13:47 +0100)
commit85f890174af1dee74051f4e7015b8e8807b3ddef
treec13ff02983e54417835a140529f3d644cd77aeb5
parent0f8d3ab362e9d3050e4862688464642a05354ec8
MEDIUM: stream-int: make si_update() synchronize flag changes before the I/O

With the new synchronous si_cs_send() at the end of process_stream(),
we're seeing re-appear the I/O layer specific part of the stream interface
which is supposed to deal with I/O event subscription. The only difference
is that now we subscribe to I/Os only after having attempted (and failed)
them.

This patch brings a cleanup in this by reintroducing stream_int_update_conn()
with the send code from process_stream(). However this alone would not be
enough because the flags which are cleared afterwards would result in the
loss of the possible events (write events only at the moment). So the flags
clearing and stream-int state updates are also performed inside si_update()
between the generic code and the I/O specific code. This definitely makes
sense as after this call we can simply check again for channel and SI flag
changes and decide to loop once again or not.
include/proto/stream_interface.h
src/stream.c
src/stream_interface.c