]> git.meshlink.io Git - meshlink/blobdiff - src/net.c
Speed up initial autoconnect after joining a mesh.
[meshlink] / src / net.c
index a1cccbdf8e875471064f7d0b1367677814e75afe..a42d933bef822a375fea4c5b4e823d4f6553f683 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -585,6 +585,10 @@ static void periodic_handler(event_loop_t *loop, void *data) {
                        terminate_connection(mesh, disconnect_from->connection, disconnect_from->connection->status.active);
                }
 
+               // reduce timeout if we don't have enough connections + outgoings
+               if(cur_connects + mesh->outgoings->count < 3) {
+                       timeout = 1;
+               }
 
                // done!