]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
move last_reply hack around to avoid const warnings
authorwessels <>
Sat, 4 Apr 1998 15:13:49 +0000 (15:13 +0000)
committerwessels <>
Sat, 4 Apr 1998 15:13:49 +0000 (15:13 +0000)
src/neighbors.cc

index 8150143707b5751efa4382778661125848af5a53..70ef4891cff1833971b7e5ed3183570cabdc8406 100644 (file)
@@ -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;