From: Guus Sliepen Date: Wed, 27 May 2020 19:07:32 +0000 (+0200) Subject: Ensure the flush timer is started if we never had any full packets to send. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=ecdd0ca7749f0c8c2d948db67c1de4b0d3c3e4ed;p=meshlink Ensure the flush timer is started if we never had any full packets to send. The flush timer ensures that if there is partial data left in the send buffer for framed UDP channels, that this is sent after the flush timeout. This was done correctly if we had previously sent full packets, but if there never was a full packet the timer wouldn't be started, and the small frames wouldn't be sent unless the application would send more data on the channel. --- diff --git a/src/utcp.c b/src/utcp.c index 8ef59a06..d068d45b 100644 --- a/src/utcp.c +++ b/src/utcp.c @@ -880,6 +880,9 @@ static void ack_unreliable_framed(struct utcp_connection *c) { // There is no partial data in the send buffer, so stop the flush timer stop_retransmit_timer(c); } + } else if(left && !timespec_isset(&c->rtrx_timeout)) { + // We have partial data and we didn't start the flush timer yet + start_flush_timer(c); } }