-/* $Id: cache_cf.cc,v 1.37 1996/04/12 00:11:02 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.38 1996/04/12 04:34:15 wessels Exp $ */
/* DEBUG: Section 3 cache_cf: Configuration file parsing */
} Wais;
int negativeTtl;
int negativeDnsTtl;
+ int positiveDnsTtl;
int readTimeout;
int lifetimeDefault;
int connectTimeout;
#define DefaultNegativeTtl (5 * 60) /* 5 min */
#define DefaultNegativeDnsTtl (2 * 60) /* 2 min */
+#define DefaultPositiveDnsTtl (360 * 60) /* 6 hours */
#define DefaultReadTimeout (15 * 60) /* 15 min */
#define DefaultLifetimeDefault (200 * 60) /* 3+ hours */
#define DefaultConnectTimeout (2 * 60) /* 2 min */
int emulate_httpd_log = DefaultCommonLogFormat; /* for fast access */
time_t neighbor_timeout = DefaultNeighborTimeout; /* for fast access */
int single_parent_bypass = 0;
+int DnsPositiveTtl = DefaultPositiveDnsTtl;
char w_space[] = " \t\n";
char config_input_line[BUFSIZ];
Config.negativeDnsTtl = i * 60;
}
+static void parsePositiveDnsLine()
+{
+ char *token;
+ int i;
+ GetInteger(i);
+ Config.positiveDnsTtl = i * 60;
+}
+
static void parseReadTimeoutLine()
{
char *token;
else if (!strcmp(token, "negative_dns_ttl"))
parseNegativeDnsLine();
+ /* Parse a positive_dns_ttl line */
+ else if (!strcmp(token, "positive_dns_ttl"))
+ parsePositiveDnsLine();
+
/* Parse a read_timeout line */
else if (!strcmp(token, "read_timeout"))
parseReadTimeoutLine();
Config.Wais.relayPort = DefaultWaisRelayPort;
Config.negativeTtl = DefaultNegativeTtl;
+ Config.negativeDnsTtl = DefaultNegativeDnsTtl;
+ Config.positiveDnsTtl = DefaultPositiveDnsTtl;
Config.readTimeout = DefaultReadTimeout;
Config.lifetimeDefault = DefaultLifetimeDefault;
Config.maxRequestSize = DefaultMaxRequestSize;
emulate_httpd_log = Config.commonLogFormat;
neighbor_timeout = (time_t) Config.neighborTimeout;
single_parent_bypass = Config.singleParentBypass;
+ DnsPositiveTtl = Config.positiveDnsTtl;
#if !ALLOW_HOT_CACHE
if (!httpd_accel_mode || Config.Accel.withProxy) {
-/* $Id: ipcache.cc,v 1.21 1996/04/11 22:52:29 wessels Exp $ */
+/* $Id: ipcache.cc,v 1.22 1996/04/12 04:34:17 wessels Exp $ */
/*
* DEBUG: Section 14 ipcache: IP Cache
char ipcache_status_char _PARAMS((ipcache_entry *));
int ipcache_hash_entry_count();
-#define IP_POS_TTL 86400 /* one day */
#define MAX_IP 1024 /* Maximum cached IP */
#define IP_LOW_WATER 70
#define IP_HIGH_WATER 90
e->entry.h_name = xstrdup(data->h_name);
e->lastref = e->timestamp = cached_curtime;
e->status = CACHED;
- e->ttl = IP_POS_TTL;
+ e->ttl = DnsPositiveTtl;
} else {
e->lastref = e->timestamp = cached_curtime;
e->status = NEGATIVE_CACHED;
e->entry.h_name = xstrdup(data->h_name);
e->lastref = e->timestamp = cached_curtime;
e->status = CACHED;
- e->ttl = IP_POS_TTL;
+ e->ttl = DnsPositiveTtl;
} else {
e->lastref = e->timestamp = cached_curtime;
e->status = NEGATIVE_CACHED;
debug(14, 4, "ipcache_parsebuffer: DNS record already resolved.\n");
} else {
e->lastref = e->timestamp = cached_curtime;
- e->ttl = IP_POS_TTL;
+ e->ttl = DnsPositiveTtl;
e->status = CACHED;
line_cur = line_head->next;