From: Guus Sliepen Date: Fri, 8 Jun 2001 18:02:10 +0000 (+0000) Subject: Only reset seconds_till_retry when we activate the outgoing connection. X-Git-Tag: import-tinc-1.1~785^2~520 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=ba918dce287788aaf6a90b3c7a9f349b197068d6;p=meshlink Only reset seconds_till_retry when we activate the outgoing connection. --- diff --git a/src/net.c b/src/net.c index e255cdde..4f399907 100644 --- a/src/net.c +++ b/src/net.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: net.c,v 1.35.4.113 2001/06/05 19:45:47 guus Exp $ + $Id: net.c,v 1.35.4.114 2001/06/08 18:02:10 guus Exp $ */ #include "config.h" @@ -99,7 +99,7 @@ int total_socket_in = 0; int total_socket_out = 0; config_t *upstreamcfg; -static int seconds_till_retry; +int seconds_till_retry = 5; int keylifetime = 0; int keyexpires = 0; @@ -1200,9 +1200,8 @@ cp { cl->status.outgoing = 0; signal(SIGALRM, sigalrm_handler); - seconds_till_retry = 5; alarm(seconds_till_retry); - syslog(LOG_NOTICE, _("Trying to re-establish outgoing connection in 5 seconds")); + syslog(LOG_NOTICE, _("Trying to re-establish outgoing connection in %d seconds"), seconds_till_retry); } /* Deactivate */ diff --git a/src/net.h b/src/net.h index c56abd85..75d59df2 100644 --- a/src/net.h +++ b/src/net.h @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: net.h,v 1.9.4.32 2001/06/05 16:09:55 guus Exp $ + $Id: net.h,v 1.9.4.33 2001/06/08 18:02:10 guus Exp $ */ #ifndef __TINC_NET_H__ @@ -98,6 +98,8 @@ extern int total_tap_out; extern int total_socket_in; extern int total_socket_out; +extern int seconds_till_retry; + extern char *request_name[256]; extern char *status_text[10]; diff --git a/src/protocol.c b/src/protocol.c index cf5cd677..de932512 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol.c,v 1.28.4.92 2001/06/05 16:09:55 guus Exp $ + $Id: protocol.c,v 1.28.4.93 2001/06/08 18:02:10 guus Exp $ */ #include "config.h" @@ -297,6 +297,8 @@ cp if(debug_lvl >= DEBUG_CONNECTIONS) syslog(LOG_NOTICE, _("Connection with %s (%s) activated"), cl->name, cl->hostname); + if(cl->status.outgoing) + seconds_till_retry = 5; /* Reset retry timeout */ cp /* Check some options */