diff --git a/src/stream_interface.c b/src/stream_interface.c index cab4371fd..e661fb2f5 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -646,10 +646,6 @@ int si_cs_send(struct conn_stream *cs) int ret; int did_send = 0; - /* We're already waiting to be able to send, give up */ - if (si->wait_event.events & SUB_RETRY_SEND) - return 0; - if (conn->flags & CO_FL_ERROR || cs->flags & (CS_FL_ERROR|CS_FL_ERR_PENDING)) { /* We're probably there because the tasklet was woken up, * but process_stream() ran before, detected there were an @@ -663,6 +659,10 @@ int si_cs_send(struct conn_stream *cs) return 1; } + /* We're already waiting to be able to send, give up */ + if (si->wait_event.events & SUB_RETRY_SEND) + return 0; + /* we might have been called just after an asynchronous shutw */ if (conn->flags & CO_FL_SOCK_WR_SH || oc->flags & CF_SHUTW) return 1;