From 37f3da43429506c13b428b34ecea81f92dcf5285 Mon Sep 17 00:00:00 2001 From: hno <> Date: Tue, 19 Sep 2006 05:17:19 +0000 Subject: [PATCH] Bug #1768: Redundant DNS PTR lookups Fix PTR lookup cache management to find pending queries. --- src/dns_internal.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); -- 2.47.3