Bug 2447: pt 1: Segfault on failed TCP DNS query
Adds debug messages for better tracking.
Aborts fatal operations early.
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;
}
{
nsvc *vc = cbdataAlloc(nsvc);
nameservers[ns].vc = vc;
+ vc->ns = ns;
struct IN_ADDR addr;
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);