Changeset

5731:902927f1c96f

Merge 0.9->trunk
author Kim Alvefur <zash@zash.se>
date Wed, 10 Jul 2013 07:47:54 +0200
parents 5729:8de1f9290588 (current diff) 5730:411e9e7d8035 (diff)
children 5732:4aa1d6f5083a
files net/dns.lua
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/net/adns.lua	Tue Jul 09 00:04:30 2013 +0100
+++ b/net/adns.lua	Wed Jul 10 07:47:54 2013 +0200
@@ -68,9 +68,9 @@
 			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
--- a/net/dns.lua	Tue Jul 09 00:04:30 2013 +0100
+++ b/net/dns.lua	Wed Jul 10 07:47:54 2013 +0200
@@ -629,10 +629,10 @@
 	else
 		sock, err = socket.udp();
 	end
+	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);