From: hno <> Date: Tue, 19 Sep 2006 05:17:19 +0000 (+0000) Subject: Bug #1768: Redundant DNS PTR lookups X-Git-Tag: SQUID_3_0_PRE5~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37f3da43429506c13b428b34ecea81f92dcf5285;p=thirdparty%2Fsquid.git Bug #1768: Redundant DNS PTR lookups Fix PTR lookup cache management to find pending queries. --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index da01aeb3cb..a443617f10 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.92 2006/08/25 12:42:57 serassio Exp $ + * $Id: dns_internal.cc,v 1.93 2006/09/18 23:17:19 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -1373,9 +1373,6 @@ idnsPTRLookup(const struct IN_ADDR addr, IDNSCB * callback, void *data) const char *ip = inet_ntoa(addr); - if (idnsCachedLookup(ip, callback, data)) - return; - q = cbdataAlloc(idns_query); q->id = idnsQueryID(); @@ -1390,6 +1387,11 @@ idnsPTRLookup(const struct IN_ADDR addr, IDNSCB * callback, void *data) return; } + if (idnsCachedLookup(q->query.name, callback, data)) { + cbdataFree(q); + return; + } + debug(78, 3) ("idnsPTRLookup: buf is %d bytes for %s, id = %#hx\n", (int) q->sz, ip, q->id);