]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
adjust sensitivity of peer RTT calculations. Changed the average factor
authorwessels <>
Fri, 26 Jun 1998 10:23:33 +0000 (10:23 +0000)
committerwessels <>
Fri, 26 Jun 1998 10:23:33 +0000 (10:23 +0000)
from 1000 to 50.  Added a call to gettimeofday() in comm_incoming().
Surely someone will protest that.

src/comm.cc
src/defines.h
src/neighbors.cc

index 52190997096d54dedf46133d4bd621df83c799fe..53dcb4393b75a33603f78c46ec84e26a1ee7dd7b 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: comm.cc,v 1.271 1998/06/10 05:47:09 wessels Exp $
+ * $Id: comm.cc,v 1.272 1998/06/26 04:23:33 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -770,6 +770,9 @@ comm_incoming(void)
     int j;
     incame = 0;
     io_events = 0;
+#if !ALARM_UPDATES_TIME
+    getCurrentTime();
+#endif
     if (theInIcpConnection > 0) {
        icpHandleUdp(theInIcpConnection, &incame);
        if (theInIcpConnection != theOutIcpConnection)
index 9267928bcdf09d2cc5e700387ae5ec1dcb4142ff..82e3b09a0dd21dea26b89e91bebe0174995ddeae 100644 (file)
 #define MAX_LOGIN_SZ  128
 
 #define PEER_MAX_ADDRESSES 10
-#define RTT_AV_FACTOR      1000
+#define RTT_AV_FACTOR      50
 
 /* flags for peer->mcast.flags */
 #define PEER_COUNT_EVENT_PENDING 1
index 60ee124c4254a13d627067e3c1219b43b09d83bb..2d1b560f7242d7262fc7dd189f8b63286d723361 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.222 1998/06/08 17:29:17 wessels Exp $
+ * $Id: neighbors.cc,v 1.223 1998/06/26 04:23:34 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -671,7 +671,8 @@ neighborAlive(peer * p, const MemObject * mem, const icp_common_t * header)
        p->stats.counts[header->opcode]++;
     if (mem) {
        rtt = tvSubMsec(mem->start_ping, current_time);
-       p->stats.rtt = intAverage(p->stats.rtt, rtt, n, RTT_AV_FACTOR);
+       if (rtt)
+           p->stats.rtt = intAverage(p->stats.rtt, rtt, n, RTT_AV_FACTOR);
        p->icp_version = (int) header->version;
     }
 }