diff options
-rw-r--r-- | net/dns.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/dns.lua b/net/dns.lua index 23a453aa..0101daa3 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -602,7 +602,11 @@ function resolver:getsocket(servernum) -- - - - - - - - - - - - - getsocket local sock = self.socket[servernum]; if sock then return sock; end - sock = socket.udp(); + local err; + sock, err = socket.udp(); + 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 |