Handle timeouts during connecting the same way as other errors.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 21 Jun 2004 14:37:52 +0000 (14:37 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 21 Jun 2004 14:37:52 +0000 (14:37 +0000)
src/net.c

index 6530316bd8062f238f4a23ca946ff9cc82ca976c..1b3d230eb4dff87b40d3e945016f9f783a3cfb71 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -248,7 +248,13 @@ static void check_dead_connections(void)
                                }
                                ifdebug(CONNECTIONS) logger(LOG_WARNING, _("Timeout from %s (%s) during authentication"),
                                                   c->name, c->hostname);
-                               terminate_connection(c, false);
+                               if(c->status.connecting) {
+                                       c->status.connecting = false;
+                                       closesocket(c->socket);
+                                       do_outgoing_connection(c);
+                               } else {
+                                       terminate_connection(c, false);
+                               }
                        }
                }
        }