aboutsummaryrefslogtreecommitdiffstats
path: root/net/adns.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-10-30 12:08:05 +0100
committerKim Alvefur <zash@zash.se>2014-10-30 12:08:05 +0100
commitaac0915942b7d95b572e1d3a9e369ea84e935e2d (patch)
tree97e459876f7dc5cd650bdc20867505af57e6c2bc /net/adns.lua
parent2773c46aa5507b1069f7ac426423ca751938c9c2 (diff)
downloadprosody-aac0915942b7d95b572e1d3a9e369ea84e935e2d.tar.gz
prosody-aac0915942b7d95b572e1d3a9e369ea84e935e2d.zip
net.adns: Log peername recorded from wrapped setpeername instead of calling sock:getpeername, it exists and throws an error on unconnected sockets (thanks wirehack7)
Diffstat (limited to 'net/adns.lua')
-rw-r--r--net/adns.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/adns.lua b/net/adns.lua
index da7981ba..3fc958f4 100644
--- a/net/adns.lua
+++ b/net/adns.lua
@@ -80,8 +80,7 @@ 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)
- local getpeername = sock.getpeername;
- log("debug", "Sending DNS query to %s", (getpeername and getpeername(sock)) or "<unconnected>");
+ log("debug", "Sending DNS query to %s", peername);
return sock:send(data);
end
return handler;