]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
skip bogus RTT calculation when start_time == 0
authorwessels <>
Sat, 5 Sep 1998 03:40:27 +0000 (03:40 +0000)
committerwessels <>
Sat, 5 Sep 1998 03:40:27 +0000 (03:40 +0000)
src/neighbors.cc

index 7ecbf6e6383c61d4748ec673d8ce91fe4f31d0b1..91ead3c63ebdbd21cce202e84a94b2d1fbf09b35 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.240 1998/08/27 06:28:57 wessels Exp $
+ * $Id: neighbors.cc,v 1.241 1998/09/04 21:40:27 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -601,9 +601,11 @@ neighborAlive(peer * p, const MemObject * mem, const icp_common_t * header)
     if ((icp_opcode) header->opcode <= ICP_END)
        p->icp.counts[header->opcode]++;
     if (mem) {
-       rtt = tvSubMsec(mem->start_ping, current_time);
-       if (rtt)
-           p->stats.rtt = intAverage(p->stats.rtt, rtt, n, RTT_AV_FACTOR);
+       if (mem->start_ping.tv_sec) {
+           rtt = tvSubMsec(mem->start_ping, current_time);
+           if (rtt)
+               p->stats.rtt = intAverage(p->stats.rtt, rtt, n, RTT_AV_FACTOR);
+       }
        p->icp.version = (int) header->version;
     }
 }