]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1768: Redundant DNS PTR lookups
authorhno <>
Tue, 19 Sep 2006 05:17:19 +0000 (05:17 +0000)
committerhno <>
Tue, 19 Sep 2006 05:17:19 +0000 (05:17 +0000)
Fix PTR lookup cache management to find pending queries.

src/dns_internal.cc

index da01aeb3cbb54424415f0d1e36397d287dbd039c..a443617f1003e2ba5ce49e577009e41abda2455b 100644 (file)
@@ -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);