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=b4e88fcfde5f9c29d10fb3ecfa718c63d4cce007;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 c4305cd4..3b45c39d 100644 --- a/src/utcp.c +++ b/src/utcp.c @@ -660,6 +660,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); } @@ -1728,6 +1729,7 @@ skip_ack: c->snd.last++; set_state(c, FIN_WAIT_1); } else { + c->do_poll = true; set_state(c, ESTABLISHED); }