Comparison

net/dns.lua @ 6857:86fcc3fa1a97

net.dns: Use new IPv4-specific socket factory if available (fixes dns on libevent with latest development version of luasocket)
author Kim Alvefur <zash@zash.se>
date Fri, 25 Sep 2015 17:32:13 +0200
parent 6780:647adfd8f738
child 6866:abff7543b79c
comparison
equal deleted inserted replaced
6856:489f4ae291bf 6857:86fcc3fa1a97
618 local ok, err; 618 local ok, err;
619 local peer = self.server[servernum]; 619 local peer = self.server[servernum];
620 if peer:find(":") then 620 if peer:find(":") then
621 sock, err = socket.udp6(); 621 sock, err = socket.udp6();
622 else 622 else
623 sock, err = socket.udp(); 623 sock, err = (socket.udp4 or socket.udp)();
624 end 624 end
625 if sock and self.socket_wrapper then sock, err = self.socket_wrapper(sock, self); end 625 if sock and self.socket_wrapper then sock, err = self.socket_wrapper(sock, self); end
626 if not sock then 626 if not sock then
627 return nil, err; 627 return nil, err;
628 end 628 end