aboutsummaryrefslogtreecommitdiffstats
path: root/net/adns.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-01-08 23:20:36 +0000
committerMatthew Wild <mwild1@gmail.com>2011-01-08 23:20:36 +0000
commit3fa72ad99ad0d58af36e4abf5431a4fa7f06dbe8 (patch)
treea4b70e2d36624a0b37e9847a4b55de35cfa91233 /net/adns.lua
parenta5cba5ec97bc5b589ef043b76b456ad66c01852c (diff)
downloadprosody-3fa72ad99ad0d58af36e4abf5431a4fa7f06dbe8.tar.gz
prosody-3fa72ad99ad0d58af36e4abf5431a4fa7f06dbe8.zip
net.adns: Fix logging to handle unconnected UDP sockets
Diffstat (limited to 'net/adns.lua')
-rw-r--r--net/adns.lua3
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;