From: Chris Hofstaedtler Date: Tue, 9 Jan 2018 19:08:12 +0000 (+0100) Subject: sendResolve: improve local socket making error message X-Git-Tag: dnsdist-1.3.0~151^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df2146ee2412b76f6c0765155f56ee276bfde008;p=pdns sendResolve: improve local socket making error message --- diff --git a/pdns/resolver.cc b/pdns/resolver.cc index b8c7d4c5a..dd9b6b3bb 100644 --- a/pdns/resolver.cc +++ b/pdns/resolver.cc @@ -156,15 +156,15 @@ uint16_t Resolver::sendResolve(const ComboAddress& remote, const ComboAddress& l } else { std::string lstr = local.toString(); std::map::iterator lptr; - // see if there is a local + // reuse an existing local socket or make a new one if ((lptr = locals.find(lstr)) != locals.end()) { sock = lptr->second; } else { // try to make socket sock = makeQuerySocket(local, true); if (sock < 0) - throw ResolverException("Unable to create socket to "+remote.toStringWithPort()+": "+stringerror()); + throw ResolverException("Unable to create local socket on "+lstr+" to "+remote.toStringWithPort()+": "+stringerror()); setNonBlocking( sock ); locals[lstr] = sock; }