]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
-report pings recv/sent
authorwessels <>
Wed, 9 Oct 1996 21:56:23 +0000 (21:56 +0000)
committerwessels <>
Wed, 9 Oct 1996 21:56:23 +0000 (21:56 +0000)
-update last_use_time in netdbHops()

src/net_db.cc

index 4d5501c00121875c93d529260a078b18abd99d3a..8ca0a52806d8521d85e81e579daf3ec89a4d5dbf 100644 (file)
@@ -256,8 +256,9 @@ netdbDump(StoreEntry * sentry)
     int k;
     int i;
     storeAppendPrintf(sentry, "{Network DB Statistics:\n");
-    storeAppendPrintf(sentry, "{%-16.16s %7s %5s %s}\n",
+    storeAppendPrintf(sentry, "{%-16.16s %7s %9s %5s %s}\n",
        "Network",
+       "recv/sent",
        "RTT",
        "Hops",
        "Hostnames");
@@ -271,8 +272,10 @@ netdbDump(StoreEntry * sentry)
        (QS) sortByHops);
     for (k = 0; k < i; k++) {
        n = *(list + k);
-       storeAppendPrintf(sentry, "{%-16.16s %7.1f %5.1f",
+       storeAppendPrintf(sentry, "{%-16.16s %4d/%4d %7.1f %5.1f",
            n->network,
+           n->pings_recv,
+           n->pings_sent,
            n->rtt,
            n->hops);
        for (x = n->hosts; x; x = x->next)
@@ -287,8 +290,10 @@ int
 netdbHops(struct in_addr addr)
 {
     netdbEntry *n = netdbLookupAddr(addr);
-    if (n && n->pings_recv)
+    if (n && n->pings_recv) {
+       n->last_use_time = squid_curtime;
        return (int) (n->hops + 0.5);
+    }
     return 256;
 }
 #endif /* USE_ICMP */