/* stop reading */
if (!(si->flags & SI_FL_WAIT_ROOM)) {
if (!(ic->flags & CF_DONT_READ)) /* full */
- si->flags |= SI_FL_WAIT_ROOM;
+ si_cant_put(si);
ic->rex = TICK_ETERNITY;
}
}
if (si->wait_event.wait_reason & SUB_CAN_RECV)
return 0;
+ /* by default nothing to deliver */
+ si_stop_put(si);
+
/* maybe we were called immediately after an asynchronous shutr */
if (ic->flags & CF_SHUTR)
return 1;
/* the pipe is full or we have read enough data that it
* could soon be full. Let's stop before needing to poll.
*/
- si->flags |= SI_FL_WAIT_ROOM;
+ si_cant_put(si);
}
/* splice not possible (anymore), let's go on on standard copy */
max = channel_recv_max(ic);
if (!max) {
- si->flags |= SI_FL_WAIT_ROOM;
+ si_cant_put(si);
break;
}
ret = cs->conn->mux->rcv_buf(cs, &ic->buf, max, co_data(ic) ? CO_RFL_BUF_WET : 0);
if (cs->flags & CS_FL_RCV_MORE)
- si->flags |= SI_FL_WAIT_ROOM;
+ si_cant_put(si);
if (ret <= 0)
break;
ic->total += ret;
if (!channel_may_recv(ic)) {
- si->flags |= SI_FL_WAIT_ROOM;
+ si_cant_put(si);
break;
}