diff options
Diffstat (limited to 'net/adns.lua')
-rw-r--r-- | net/adns.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/adns.lua b/net/adns.lua index a3b07b09..cd69a627 100644 --- a/net/adns.lua +++ b/net/adns.lua @@ -79,7 +79,8 @@ function new_async_socket(sock, resolver) 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 "<unconnected>"); return sock:send(data); end return handler; |