From: Guus Sliepen Date: Wed, 27 May 2020 19:00:32 +0000 (+0200) Subject: Ensure the poll callback is called when a channel is fully established. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=ac0ab72aa69853dccc8ae048ca7888ed2f95a7de;p=meshlink Ensure the poll callback is called when a channel is fully established. The optimization that reduced how often the poll callback is called when the application did not write anything to the channel in the callback also inadvertently stopped it from being called right when the channel is fully established. --- diff --git a/src/utcp.c b/src/utcp.c index 2a1ac5b8..cbc094a1 100644 --- a/src/utcp.c +++ b/src/utcp.c @@ -677,6 +677,7 @@ void utcp_accept(struct utcp_connection *c, utcp_recv_t recv, void *priv) { debug(c, "accepted %p %p\n", c, recv, priv); c->recv = recv; c->priv = priv; + c->do_poll = true; set_state(c, ESTABLISHED); } @@ -2025,6 +2026,7 @@ skip_ack: c->snd.last++; set_state(c, FIN_WAIT_1); } else { + c->do_poll = true; set_state(c, ESTABLISHED); }