/*
- * $Id: cache_cf.cc,v 1.102 1996/10/07 17:14:52 wessels Exp $
+ * $Id: cache_cf.cc,v 1.103 1996/10/08 19:37:33 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
#define DefaultIpcacheLow 90
#define DefaultIpcacheHigh 95
#define DefaultMaxHotvmObjSize (256<<10) /* 256k */
+#define DefaultMinDirectHops 4
int httpd_accel_mode = 0; /* for fast access */
char *DefaultSwapDir = DEFAULT_SWAP_DIR;
else if (!strcmp(token, "max_hotvm_obj_size"))
parseIntegerValue(&Config.maxHotvmObjSize);
+ else if (!strcmp(token, "minimum_direct_hops"))
+ parseIntegerValue(&Config.minDirectHops);
+
/* If unknown, treat as a comment line */
else {
debug(3, 0, "parseConfigFile: line %d unrecognized: '%s'\n",
Config.ipcache.low = DefaultIpcacheLow;
Config.ipcache.high = DefaultIpcacheHigh;
Config.maxHotvmObjSize = DefaultMaxHotvmObjSize;
+ Config.minDirectHops = DefaultMinDirectHops;
}
static void
n = netdbAdd(addr, hostname);
debug(37, 3, "netdbSendPing: pinging %s\n", hostname);
icmpDomainPing(addr, hostname);
+ n->pings_sent++;
n->next_ping_time = squid_curtime + NET_DB_TTL;
n->last_use_time = squid_curtime;
xfree(hostname);
N = 100;
n->hops = ((n->hops * (N - 1)) + hops) / N;
n->rtt = ((n->rtt * (N - 1)) + rtt) / N;
+ n->pings_recv++;
debug(37, 3, "netdbHandlePingReply: %s; rtt=%5.1f hops=%4.1f\n",
n->network,
n->rtt,
xfree(list);
}
+int
+netdbHops(struct in_addr addr)
+{
+ netdbEntry *n = netdbLookupAddr(addr);
+ if (n && n->pings_recv)
+ return (int) (n->hops + 0.5);
+ return 256;
+}
#endif /* USE_ICMP */