/*
- * $Id: cache_cf.cc,v 1.139 1996/11/15 07:51:05 wessels Exp $
+ * $Id: cache_cf.cc,v 1.140 1996/11/16 07:07:07 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
#define DefaultSwapMaxSize (100 << 10) /* 100 MB (100*1024 kbytes) */
#define DefaultSwapHighWaterMark 90 /* 90% */
#define DefaultSwapLowWaterMark 75 /* 75% */
+#define DefaultNetdbHigh 1000 /* counts, not percents */
+#define DefaultNetdbLow 900
#define DefaultWaisRelayHost (char *)NULL
#define DefaultWaisRelayPort 0
else if (!strcmp(token, "swap_level2_dirs"))
parseIntegerValue(&Config.levelTwoDirs);
+ else if (!strcmp(token, "netdb_high"))
+ parseIntegerValue(&Config.Netdb.high);
+ else if (!strcmp(token, "netdb_low"))
+ parseIntegerValue(&Config.Netdb.low);
+ else if (!strcmp(token, "netdb_ttl"))
+ parseIntegerValue(&Config.Netdb.ttl);
+
/* If unknown, treat as a comment line */
else {
debug(3, 0, "parseConfigFile: line %d unrecognized: '%s'\n",
Config.Swap.maxSize = DefaultSwapMaxSize;
Config.Swap.highWaterMark = DefaultSwapHighWaterMark;
Config.Swap.lowWaterMark = DefaultSwapLowWaterMark;
+ Config.Netdb.high = DefaultNetdbHigh;
+ Config.Netdb.low = DefaultNetdbLow;
Config.Wais.relayHost = safe_xstrdup(DefaultWaisRelayHost);
Config.Wais.relayPort = DefaultWaisRelayPort;
#if USE_ICMP
-#define NET_DB_TTL 300
-
-#define NETDB_LOW_MARK 900
-#define NETDB_HIGH_MARK 1000
-
static HashID addr_table;
static HashID host_table;
sizeof(netdbEntry *),
(QS) netdbLRU);
for (k = 0; k < list_count; k++) {
- if (meta_data.netdb_addrs < NETDB_LOW_MARK)
+ if (meta_data.netdb_addrs < Config.Netdb.low)
break;
netdbRelease(*(list + k));
removed++;
netdbAdd(struct in_addr addr, const char *hostname)
{
netdbEntry *n;
- if (meta_data.netdb_addrs > NETDB_HIGH_MARK)
+ if (meta_data.netdb_addrs > Config.Netdb.high)
netdbPurgeLRU();
if ((n = netdbLookupAddr(addr)) == NULL) {
n = xcalloc(1, sizeof(netdbEntry));
debug(37, 3, "netdbSendPing: pinging %s\n", hostname);
icmpDomainPing(addr, hostname);
n->pings_sent++;
- n->next_ping_time = squid_curtime + NET_DB_TTL;
+ n->next_ping_time = squid_curtime + Config.Netdb.ttl;
n->last_use_time = squid_curtime;
xfree(hostname);
}