aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-07-10 07:45:10 +0200
committerKim Alvefur <zash@zash.se>2013-07-10 07:45:10 +0200
commit6d1a2de3d79fa6c710cf24a695b91b5ca80e6527 (patch)
tree9567263f0c149d8f808508d42366f33e83f6058c /net
parent435fa06770d6f2e5281b6257d1348845fda8ef80 (diff)
downloadprosody-6d1a2de3d79fa6c710cf24a695b91b5ca80e6527.tar.gz
prosody-6d1a2de3d79fa6c710cf24a695b91b5ca80e6527.zip
net.dns, net.adns: Make sure errors from net.server are propagated (thanks asterix)
Diffstat (limited to 'net')
-rw-r--r--net/adns.lua4
-rw-r--r--net/dns.lua2
2 files changed, 3 insertions, 3 deletions
diff --git a/net/adns.lua b/net/adns.lua
index cd69a627..158747c6 100644
--- a/net/adns.lua
+++ b/net/adns.lua
@@ -68,9 +68,9 @@ function new_async_socket(sock, resolver)
resolver:servfail(conn); -- Let the magic commence
end
end
- handler = server.wrapclient(sock, "dns", 53, listener);
+ handler, err = server.wrapclient(sock, "dns", 53, listener);
if not handler then
- log("warn", "handler is nil");
+ return nil, err;
end
handler.settimeout = function () end
diff --git a/net/dns.lua b/net/dns.lua
index 89b50255..cdd949a2 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -622,10 +622,10 @@ function resolver:getsocket(servernum) -- - - - - - - - - - - - - getsocket
local err;
sock, err = socket.udp();
+ if sock and self.socket_wrapper then sock, err = self.socket_wrapper(sock, self); end
if not sock then
return nil, err;
end
- if self.socket_wrapper then sock = self.socket_wrapper(sock, self); end
sock:settimeout(0);
-- todo: attempt to use a random port, fallback to 0
sock:setsockname('*', 0);