]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
* Lower the priority of DNS "giving up after..." messages to debuglevel 2.
authorhno <>
Mon, 1 Oct 2001 20:20:02 +0000 (20:20 +0000)
committerhno <>
Mon, 1 Oct 2001 20:20:02 +0000 (20:20 +0000)
* Make DNS use udp_incoming_address id udp_outgoing_address isn't set

* Log the address and port of the DNS query port, not only the internal FD

src/dns_internal.cc

index f04e461a4f712184f0f69f8be91dcbbca8070001..c91033834ebf2d17ccb93ac2b10f735a4e6dd51c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dns_internal.cc,v 1.40 2001/08/16 00:16:16 hno Exp $
+ * $Id: dns_internal.cc,v 1.41 2001/10/01 14:20:02 hno Exp $
  *
  * DEBUG: section 78    DNS lookups; interacts with lib/rfc1035.c
  * AUTHOR: Duane Wessels
@@ -579,7 +579,7 @@ idnsCheckQueue(void *unused)
            idnsSendQuery(q);
        } else {
            int v = cbdataValid(q->callback_data);
-           debug(78, 1) ("idnsCheckQueue: ID %x: giving up after %d tries and %5.1f seconds\n",
+           debug(78, 2) ("idnsCheckQueue: ID %x: giving up after %d tries and %5.1f seconds\n",
                (int) q->id, q->nsends,
                tvSubDsec(q->start_t, current_time));
            cbdataUnlock(q->callback_data);
@@ -613,15 +613,27 @@ idnsInit(void)
 {
     static int init = 0;
     if (DnsSocket < 0) {
+       int port;
+       struct in_addr addr;
+       if (Config.Addrs.udp_outgoing.s_addr != no_addr.s_addr)
+           addr = Config.Addrs.udp_outgoing;
+       else
+           addr = Config.Addrs.udp_incoming;
        DnsSocket = comm_open(SOCK_DGRAM,
            0,
-           Config.Addrs.udp_outgoing,
+           addr,
            0,
            COMM_NONBLOCKING,
            "DNS Socket");
        if (DnsSocket < 0)
            fatal("Could not create a DNS socket");
-       debug(78, 1) ("DNS Socket created on FD %d\n", DnsSocket);
+       /* Ouch... we can't call functions using debug from a debug
+        * statement. Doing so messes up the internal _db_level
+        */
+       port = comm_local_port(DnsSocket);
+       debug(78, 1) ("DNS Socket created at %s, port %d, FD %d\n", 
+           inet_ntoa(addr),
+           port, DnsSocket);
     }
     assert(0 == nns);
     idnsParseNameservers();