Update aiodns

This commit is contained in:
Netch
2021-08-14 09:12:32 +08:00
parent ce5f39fab1
commit c50ba8f56c

View File

@@ -30,9 +30,9 @@ var (
CDNS = dns.Client{}
ODNS = dns.Client{}
mux *dns.ServeMux
tcpSocket net.Listener
udpSocket net.PacketConn
mux *dns.ServeMux = nil
tcpSocket net.Listener = nil
udpSocket net.PacketConn = nil
)
//export aiodns_dial
@@ -130,7 +130,17 @@ func aiodns_init() bool {
//export aiodns_free
func aiodns_free() {
if tcpSocket != nil {
tcpSocket.Close()
tcpSocket = nil
}
if udpSocket != nil {
udpSocket.Close()
udpSocket = nil
}
mux = nil
}
func handleServerName(w dns.ResponseWriter, m *dns.Msg) {