/*
- * $Id: fqdncache.cc,v 1.157 2003/12/04 10:17:16 hno Exp $
+ * $Id: fqdncache.cc,v 1.158 2004/04/03 14:35:48 hno Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
f.flags.negcached = 0;
ttl = atoi(token);
- if (ttl > 0)
+ if (ttl > 0 && ttl < Config.positiveDnsTtl)
f.expires = squid_curtime + ttl;
else
f.expires = squid_curtime + Config.positiveDnsTtl;
f.name_count = 1;
- f.expires = squid_curtime + answers[k].ttl;
+ if ((int) answers[k].ttl < Config.positiveDnsTtl)
+ f.expires = squid_curtime + answers[k].ttl;
+ else
+ f.expires = squid_curtime + Config.positiveDnsTtl;
return &f;
}
/*
- * $Id: ipcache.cc,v 1.242 2003/02/21 22:50:09 robertc Exp $
+ * $Id: ipcache.cc,v 1.243 2004/04/03 14:35:48 hno Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
i.flags.negcached = 0;
ttl = atoi(token);
- if (ttl > 0)
+ if (ttl > 0 && ttl < Config.positiveDnsTtl)
i.expires = squid_curtime + ttl;
else
i.expires = squid_curtime + Config.positiveDnsTtl;
if (answers[k]._class != RFC1035_CLASS_IN)
continue;
- if (j == 0)
- i.expires = squid_curtime + answers[k].ttl;
+ if (j == 0) {
+ if ((int) answers[k].ttl < Config.positiveDnsTtl)
+ i.expires = squid_curtime + answers[k].ttl;
+ else
+ i.expires = squid_curtime + Config.positiveDnsTtl;
+ }
assert(answers[k].rdlength == 4);