(conn->flags & (CO_FL_CONNECTED | CO_FL_HANDSHAKE)) == CO_FL_CONNECTED) {
si->exp = TICK_ETERNITY;
oc->flags |= CF_WRITE_NULL;
+ if (si->state == SI_ST_CON)
+ si->state = SI_ST_RDY;
}
/* Report EOI on the channel if it was reached from the mux point of
if (ret > 0) {
oc->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA;
did_send = 1;
+ if (si->state == SI_ST_CON)
+ si->state = SI_ST_RDY;
}
if (!oc->pipe->data) {
if (ret > 0) {
did_send = 1;
oc->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA;
+ if (si->state == SI_ST_CON)
+ si->state = SI_ST_RDY;
co_set_data(oc, co_data(oc) - ret);
c_realign_if_empty(oc);
ic->total += ret;
cur_read += ret;
ic->flags |= CF_READ_PARTIAL;
+ if (si->state == SI_ST_CON)
+ si->state = SI_ST_RDY;
}
if (cs->flags & CS_FL_EOS)
ic->flags |= CF_READ_PARTIAL;
ic->total += ret;
+ if (si->state == SI_ST_CON)
+ si->state = SI_ST_RDY;
if ((ic->flags & CF_READ_DONTWAIT) || --read_poll <= 0) {
/* we're stopped by the channel's policy */
/* Don't change the state to SI_ST_DIS yet if we're still
* in SI_ST_CON, otherwise it means sess_establish() hasn't
- * been called yet, and so the analysers would not run.
+ * been called yet, and so the analysers would not run. However
+ * it's fine to switch to SI_ST_RDY as we have really validated
+ * the connection.
*/
if (si->state == SI_ST_EST)
si->state = SI_ST_DIS;
+ else if (si->state == SI_ST_CON)
+ si->state = SI_ST_RDY;
si->exp = TICK_ETERNITY;
return;
}