# HG changeset patch # User Matthew Wild # Date 1294528836 0 # Node ID c994524ef9530e1e947f67ae4d9f64d25ccf68bd # Parent 9df4e61c260b2dbb2e24b91139c9364998b42b02 net.adns: Fix logging to handle unconnected UDP sockets diff -r 9df4e61c260b -r c994524ef953 net/adns.lua --- a/net/adns.lua Sat Jan 08 23:20:16 2011 +0000 +++ b/net/adns.lua Sat Jan 08 23:20:36 2011 +0000 @@ -79,7 +79,8 @@ handler.connect = function (_, ...) return sock:connect(...) end --handler.send = function (_, data) _:write(data); return _.sendbuffer and _.sendbuffer(); end handler.send = function (_, data) - log("debug", "Sending DNS query to %s", sock:getpeername()); + local getpeername = sock.getpeername; + log("debug", "Sending DNS query to %s", (getpeername and getpeername(sock)) or ""); return sock:send(data); end return handler;