net.adns: Fix potential traceback on DNS responses with libevent enabled (thanks Flo)
authorMatthew Wild <mwild1@gmail.com>
Tue, 16 Feb 2010 15:05:18 +0000
changeset 2652 cbc58fc170ad
parent 2651 0c40e60a4367
child 2653 7491cef7b5c5
child 2654 07a6f5f9d4be
net.adns: Fix potential traceback on DNS responses with libevent enabled (thanks Flo)
net/adns.lua
--- a/net/adns.lua	Mon Feb 15 23:06:57 2010 +0000
+++ b/net/adns.lua	Tue Feb 16 15:05:18 2010 +0000
@@ -49,7 +49,9 @@
 	local listener = {};
 	local handler = {};
 	function listener.onincoming(conn, data)
-		dns.feed(handler, data);
+		if data then
+			dns.feed(handler, data);
+		end
 	end
 	function listener.ondisconnect(conn, err)
 		log("warn", "DNS socket for %s disconnected: %s", peername, err);