# HG changeset patch # User Matthew Wild # Date 1266511466 0 # Node ID be4b1e796bd2c1496a017af48104c17714e00583 # Parent 9e5b21b7b2f9d9d714ab37592f8ceb0b858d3637 net.adns: Don't treat locally-initiated disconnects as fatal with libevent backend in use (thanks Flo) diff -r 9e5b21b7b2f9 -r be4b1e796bd2 net/adns.lua --- a/net/adns.lua Thu Feb 18 16:41:53 2010 +0000 +++ b/net/adns.lua Thu Feb 18 16:44:26 2010 +0000 @@ -54,13 +54,15 @@ end end function listener.ondisconnect(conn, err) - log("warn", "DNS socket for %s disconnected: %s", peername, err); - local servers = resolver.server; - if resolver.socketset[conn] == resolver.best_server and resolver.best_server == #servers then - log("error", "Exhausted all %d configured DNS servers, next lookup will try %s again", #servers, servers[1]); + if err then + log("warn", "DNS socket for %s disconnected: %s", peername, err); + local servers = resolver.server; + if resolver.socketset[conn] == resolver.best_server and resolver.best_server == #servers then + log("error", "Exhausted all %d configured DNS servers, next lookup will try %s again", #servers, servers[1]); + end + + resolver:servfail(conn); -- Let the magic commence end - - resolver:servfail(conn); -- Let the magic commence end handler = server.wrapclient(sock, "dns", 53, listener); if not handler then