X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fnet.c;fp=src%2Fnet.c;h=b299bf18ebfc2255415c612db8bed0e57a2d4bc7;hp=67603f7d277f66969e5a63d48013c71d0aee4c01;hb=33f241d97852d7a171f1aaf1bda7f66356ff889e;hpb=601f3b2dd746ff5726eca256861f2ecf662b3a55 diff --git a/src/net.c b/src/net.c index 67603f7d..b299bf18 100644 --- a/src/net.c +++ b/src/net.c @@ -3,6 +3,7 @@ Copyright (C) 1998-2005 Ivo Timmermans, 2000-2011 Guus Sliepen 2006 Scott Lamb + 2011 Loïc Grenié This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -166,14 +167,14 @@ static void timeout_handler(int fd, short events, void *event) { next = node->next; c = node->data; - if(c->last_ping_time + pingtimeout < now) { + if(c->last_ping_time + pingtimeout <= now) { if(c->status.active) { if(c->status.pinged) { ifdebug(CONNECTIONS) logger(LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", c->name, c->hostname, now - c->last_ping_time); terminate_connection(c, true); continue; - } else if(c->last_ping_time + pinginterval < now) { + } else if(c->last_ping_time + pinginterval <= now) { send_ping(c); } } else {