if (count != co_data(sc_oc(sc))) {
sc_oc(sc)->flags |= CF_WRITE_EVENT | CF_WROTE_DATA;
sc_have_room(sc_opposite(sc));
- sc_ep_report_send_activity(sc);
- }
- else {
- if (sc_ep_test(sc, SE_FL_WONT_CONSUME))
- sc_ep_report_send_activity(sc);
- else
- sc_ep_report_blocked_send(sc);
}
if (sc_ic(sc)->flags & CF_READ_EVENT)
sc_ep_report_read_activity(sc);
+ if (channel_is_empty(sc_oc(sc)))
+ sc_ep_report_send_activity(sc);
+ else
+ sc_ep_report_blocked_send(sc);
+
/* measure the call rate and check for anomalies when too high */
if (((b_size(sc_ib(sc)) && sc->flags & SC_FL_NEED_BUFF) || // asks for a buffer which is present
(b_size(sc_ib(sc)) && !b_data(sc_ib(sc)) && sc->flags & SC_FL_NEED_ROOM) || // asks for room in an empty buffer
oc->flags |= CF_WRITE_EVENT | CF_WROTE_DATA;
if (sc->state == SC_ST_CON)
sc->state = SC_ST_RDY;
-
sc_have_room(sc_opposite(sc));
- sc_ep_report_send_activity(sc);
}
- else
- sc_ep_report_blocked_send(sc);
if (sc_ep_test(sc, SE_FL_ERROR | SE_FL_ERR_PENDING)) {
oc->flags |= CF_WRITE_EVENT;
return 1;
}
- /* We couldn't send all of our data, let the mux know we'd like to send more */
- if (!channel_is_empty(oc))
+ if (channel_is_empty(oc))
+ sc_ep_report_send_activity(sc);
+ else {
+ /* We couldn't send all of our data, let the mux know we'd like to send more */
conn->mux->subscribe(sc, SUB_RETRY_SEND, &sc->wait_event);
+ sc_ep_report_blocked_send(sc);
+ }
+
return did_send;
}