--------------------- PatchSet 11774 Date: 2007/11/26 10:59:09 Author: adrian Branch: SQUID_2_6 Tag: (none) Log: Author: hno Patchset 11725 (HEAD): Bug #2100: Respect DNS ttl=0 Some DNS servers responds with a ttl=0 asking their results to not be cached for long, but due to historical reasons from before when Squid had an internal DNS client such DNS responses got cached for the positive DNS ttl (default 1 hour). Witch this change such DNS responses gets cached for the minimum allowed TTL (negative_dns_ttl, default 1 minute). Members: src/fqdncache.c:1.156.2.1->1.156.2.2 src/ipcache.c:1.245.2.2->1.245.2.3 Index: squid/src/fqdncache.c =================================================================== RCS file: /cvsroot/squid/squid/src/fqdncache.c,v retrieving revision 1.156.2.1 retrieving revision 1.156.2.2 diff -u -r1.156.2.1 -r1.156.2.2 --- squid/src/fqdncache.c 17 Sep 2007 20:28:16 -0000 1.156.2.1 +++ squid/src/fqdncache.c 26 Nov 2007 10:59:09 -0000 1.156.2.2 @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.c,v 1.156.2.1 2007/09/17 20:28:16 hno Exp $ + * $Id: fqdncache.c,v 1.156.2.2 2007/11/26 10:59:09 adrian Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -316,7 +316,7 @@ f->error_message = xstrdup("No PTR record"); return f; } - if (ttl == 0 || ttl > Config.positiveDnsTtl) + if (ttl > Config.positiveDnsTtl) ttl = Config.positiveDnsTtl; if (ttl < Config.negativeDnsTtl) ttl = Config.negativeDnsTtl; Index: squid/src/ipcache.c =================================================================== RCS file: /cvsroot/squid/squid/src/ipcache.c,v retrieving revision 1.245.2.2 retrieving revision 1.245.2.3 diff -u -r1.245.2.2 -r1.245.2.3 --- squid/src/ipcache.c 17 Sep 2007 20:28:16 -0000 1.245.2.2 +++ squid/src/ipcache.c 26 Nov 2007 10:59:09 -0000 1.245.2.3 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.c,v 1.245.2.2 2007/09/17 20:28:16 hno Exp $ + * $Id: ipcache.c,v 1.245.2.3 2007/11/26 10:59:09 adrian Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -369,7 +369,7 @@ i->addrs.count = (unsigned char) na; else i->addrs.count = 255; - if (ttl == 0 || ttl > Config.positiveDnsTtl) + if (ttl > Config.positiveDnsTtl) ttl = Config.positiveDnsTtl; if (ttl < Config.negativeDnsTtl) ttl = Config.negativeDnsTtl;