Diff

net/dns.lua @ 2068:1e1ee53d7f6e

net.dns: Initialize default resolver on module load (instead of on first use).
author Waqas Hussain <waqas20@gmail.com>
date Mon, 02 Nov 2009 00:52:35 +0500
parent 2067:0ed6369605bf
child 2069:72357b1c6d88
line wrap: on
line diff
--- a/net/dns.lua	Mon Nov 02 00:46:43 2009 +0500
+++ b/net/dns.lua	Mon Nov 02 00:52:35 2009 +0500
@@ -889,7 +889,6 @@
 
 
 local function resolve (func, ...)    -- - - - - - - - - - - - - - resolver_get
-  dns._resolver = dns._resolver or dns.resolver ()
   return func (dns._resolver, ...)
   end
 
@@ -930,5 +929,6 @@
 function dns:socket_wrapper_set (...)    -- - - - - - - - -  socket_wrapper_set
   return resolve (resolver.socket_wrapper_set, ...)  end
 
+dns._resolver = dns.resolver ()
 
 return dns