]> git.meshlink.io Git - meshlink/commitdiff
Don't use fast timeouts for fully established connections.
authorGuus Sliepen <guus@meshlink.io>
Fri, 25 Sep 2020 19:53:12 +0000 (21:53 +0200)
committerGuus Sliepen <guus@meshlink.io>
Fri, 25 Sep 2020 19:53:12 +0000 (21:53 +0200)
During the fast retry period, we want to have a fast ping timeout until we have
a fully working connection. However, the code still used fast timeouts during
the fast retry window even if the connection was fully established.

src/net.c

index 1614d843b24e44117e7871b49479ff782e18640b..5689a0401883d9b4b3836f35dcbab09eef663eea 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -117,7 +117,7 @@ static void timeout_handler(event_loop_t *loop, void *data) {
                int pingtimeout = c->node ? mesh->dev_class_traits[c->node->devclass].pingtimeout : default_timeout;
                int pinginterval = c->node ? mesh->dev_class_traits[c->node->devclass].pinginterval : default_interval;
 
-               if(c->outgoing && c->outgoing->timeout < 5) {
+               if(c->outgoing && !c->status.active && c->outgoing->timeout < 5) {
                        pingtimeout = 1;
                }