]> granicus.if.org Git - pdns/commitdiff
sendResolve: improve local socket making error message
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Tue, 9 Jan 2018 19:08:12 +0000 (20:08 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Tue, 9 Jan 2018 19:08:12 +0000 (20:08 +0100)
pdns/resolver.cc

index b8c7d4c5ad96126e597fa6baff764b22e518b053..dd9b6b3bbfcea983f81f3ea0571df971b95809d2 100644 (file)
@@ -156,15 +156,15 @@ uint16_t Resolver::sendResolve(const ComboAddress& remote, const ComboAddress& l
   } else {
     std::string lstr = local.toString();
     std::map<std::string, int>::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;
     }