}
}
/* We couldn't send all of our data, let the mux know we'd like to send more */
- if (co_data(oc))
+ if (!channel_is_empty(oc))
conn->mux->subscribe(cs, SUB_CAN_SEND, &si->wait_event);
return did_send;
}
if (!cs)
return NULL;
- if (!(si->wait_event.wait_reason & SUB_CAN_SEND) && co_data(si_oc(si)))
+ if (!(si->wait_event.wait_reason & SUB_CAN_SEND) && !channel_is_empty(si_oc(si)))
ret = si_cs_send(cs);
if (!(si->wait_event.wait_reason & SUB_CAN_RECV)) {
ret |= si_cs_recv(cs);
if (!(ic->flags & CF_SHUTR)) {
/* Read not closed, update FD status and timeout for reads */
- if ((ic->flags & CF_DONT_READ) || co_data(ic)) {
+ if ((ic->flags & CF_DONT_READ) || !channel_is_empty(ic)) {
/* stop reading, imposed by channel's policy or contents */
si_cant_put(si);
ic->rex = TICK_ETERNITY;
!(si->flags & SI_FL_WAIT_DATA)) /* not waiting for data */
return;
- if (!(si->wait_event.wait_reason & SUB_CAN_SEND) && co_data(si_oc(si)))
+ if (!(si->wait_event.wait_reason & SUB_CAN_SEND) && !channel_is_empty(si_oc(si)))
si_cs_send(cs);
if (cs->flags & CS_FL_ERROR || cs->conn->flags & CO_FL_ERROR) {