# HG changeset patch # User Matthew Wild # Date 1293166294 0 # Node ID 79eff24765969798a3235fdaea75e181c49538b9 # Parent 5af5fdaaa9401539680d2ff998df4a4bb979f33a net.dns: resolver:getsocket(): Return nil, err on failure diff -r 5af5fdaaa940 -r 79eff2476596 net/dns.lua --- a/net/dns.lua Fri Dec 24 04:49:30 2010 +0000 +++ b/net/dns.lua Fri Dec 24 04:51:34 2010 +0000 @@ -602,7 +602,11 @@ 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