From: Amos Jeffries Date: Sat, 11 Oct 2008 13:45:20 +0000 (+1300) Subject: Author: Henrik Nordstrom X-Git-Tag: SQUID_3_0_STABLE10~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73c480de0cee47cb39b72df4b9bd3cebfec79e46;p=thirdparty%2Fsquid.git Author: Henrik Nordstrom Bug 2447: pt 1: Segfault on failed TCP DNS query Adds debug messages for better tracking. Aborts fatal operations early. --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 32d951d459..dab4b94c1f 100755 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -715,6 +715,7 @@ idnsInitVCConnected(int fd, comm_err_t status, int xerrno, void *data) nsvc * vc = (nsvc *)data; if (status != COMM_OK) { + debugs(78, 1, "idnsInitVCConnected: Failed to connect to nameserver " << inet_ntoa(nameservers[vc->ns].S.sin_addr) << " using TCP!"); comm_close(fd); return; } @@ -739,6 +740,7 @@ idnsInitVC(int ns) { nsvc *vc = cbdataAlloc(nsvc); nameservers[ns].vc = vc; + vc->ns = ns; struct IN_ADDR addr; @@ -776,6 +778,11 @@ idnsSendQueryVC(idns_query * q, int ns) nsvc *vc = nameservers[ns].vc; + if (!vc) { + debugs(78, 1, "idnsSendQuery: Failed to initiate TCP connection to nameserver " << inet_ntoa(nameservers[ns].S.sin_addr) << "!"); + return; + } + vc->queue->reset(); short head = htons(q->sz);