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.
/* Read not closed, it doesn't seem we have to do anything here */
}
- if (!(oc->flags & CF_SHUTW)) {
- /* Write not closed */
- if (!channel_is_empty(oc) &&
- !(cs->conn->flags & CO_FL_ERROR) &&
- !(cs->flags & CS_FL_ERROR) &&
- !(oc->flags & CF_SHUTW) &&
- !(si->wait_event.wait_reason & SUB_CAN_SEND))
- si_cs_send(cs);
+ if (!(oc->flags & CF_SHUTW) && /* Write not closed */
+ !channel_is_empty(oc) &&
+ !(cs->flags & CS_FL_ERROR) &&
+ !(cs->conn->flags & CO_FL_ERROR)) {
+ si_cs_process(cs);
}
}