/*
- * $Id: ipcache.cc,v 1.47 1996/08/28 17:22:07 wessels Exp $
+ * $Id: ipcache.cc,v 1.48 1996/08/28 17:34:29 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
int ipcount;
int aliascount;
debug(14, 5, "ipcache_parsebuffer: parsing:\n%s", inbuf);
+ memset(&i, '\0', sizeof(ipcache_entry));
+ i.expires = squid_curtime + Config.positiveDnsTtl;
+ i.status = IP_DISPATCHED;
for (token = strtok(buf, w_space); token; token = strtok(NULL, w_space)) {
if (!strcmp(token, "$end")) {
break;
} else if (!strcmp(token, "$fail")) {
if ((token = strtok(NULL, w_space)) == NULL)
fatal_dump("Invalid $fail");
+ i.expires = squid_curtime + Config.negativeDnsTtl;
+ i.status = IP_NEGATIVE_CACHED;
} else if (!strcmp(token, "$message")) {
if ((token = strtok(NULL, "\n")) == NULL)
fatal_dump("Invalid $message");
} else if (!strcmp(token, "$name")) {
if ((token = strtok(NULL, w_space)) == NULL)
fatal_dump("Invalid $name");
+ i.status = IP_CACHED;
} else if (!strcmp(token, "$h_name")) {
if ((token = strtok(NULL, w_space)) == NULL)
fatal_dump("Invalid $h_name");
n = ++IpcacheStats.replies;
dnsData->offset += len;
dnsData->ip_inbuf[dnsData->offset] = '\0';
-
+ i = dnsData->data;
+ if (i->status != IP_DISPATCHED)
+ fatal_dump("ipcache_dnsHandleRead: bad status");
if (strstr(dnsData->ip_inbuf, "$end\n")) {
/* end of record found */
svc_time = tvSubMsec(dnsData->dispatch_time, current_time);
i->alias_count = x->alias_count;
i->entry = x->entry;
i->error_message = x->error_message;
+ i->status = x->status;
ipcache_call_pending(i);
}
}