From: wessels <> Date: Sat, 4 Apr 1998 15:13:49 +0000 (+0000) Subject: move last_reply hack around to avoid const warnings X-Git-Tag: SQUID_3_0_PRE1~3626 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae95b16ffb1d080db69d357649e1ffa31c038323;p=thirdparty%2Fsquid.git move last_reply hack around to avoid const warnings --- diff --git a/src/neighbors.cc b/src/neighbors.cc index 8150143707..70ef4891cf 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.191 1998/04/04 07:47:51 wessels Exp $ + * $Id: neighbors.cc,v 1.192 1998/04/04 08:13:49 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -488,6 +488,12 @@ neighborsUdpPing(request_t * request, } else if (neighborUp(p)) { /* its alive, expect a reply from it */ (*exprep)++; + } else if (squid_curtime - p->stats.last_query > Config.Timeout.deadPeer) { + /* + * fake a recent reply if its been a long time since our + * last query + */ + p->stats.last_reply = squid_curtime; } else { /* Neighbor is dead; ping it anyway, but don't expect a reply */ /* log it once at the threshold */ @@ -766,10 +772,8 @@ neighborUp(const peer * p) { if (!p->tcp_up) return 0; - if (squid_curtime - p->stats.last_query > Config.Timeout.deadPeer) { - p->stats.last_reply = squid_curtime; /* fake! */ + if (squid_curtime - p->stats.last_query > Config.Timeout.deadPeer) return 1; - } if (p->stats.last_query - p->stats.last_reply >= Config.Timeout.deadPeer) return 0; return 1;