MEDIUM: stream-int: call si_cs_process() in stream_int_update_conn

Calling si_cs_send() alone is always dangerous because it can result
in the loss of an event if it manages to empty the buffer. Indeed, in
this case it's critical to call si_chk_rcv() on the opposite stream-int.
Given that si_cs_process() takes care of all this, let's call it instead.
All this code could possibly be refined soon to avoid redoing the whole
stream_int_notify() and do it only after a send(), but at the moment it's
not important.
This commit is contained in:
Willy Tarreau 2018-10-28 13:32:08 +01:00
parent 85f890174a
commit eafd8ebcfe

View File

@ -815,14 +815,11 @@ void stream_int_update_conn(struct stream_interface *si)
/* Read not closed, it doesn't seem we have to do anything here */ /* Read not closed, it doesn't seem we have to do anything here */
} }
if (!(oc->flags & CF_SHUTW)) { if (!(oc->flags & CF_SHUTW) && /* Write not closed */
/* Write not closed */ !channel_is_empty(oc) &&
if (!channel_is_empty(oc) &&
!(cs->conn->flags & CO_FL_ERROR) &&
!(cs->flags & CS_FL_ERROR) && !(cs->flags & CS_FL_ERROR) &&
!(oc->flags & CF_SHUTW) && !(cs->conn->flags & CO_FL_ERROR)) {
!(si->wait_event.wait_reason & SUB_CAN_SEND)) si_cs_process(cs);
si_cs_send(cs);
} }
} }