mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
dns: add length check to avoid panic
This commit is contained in:
1 parent
665d722d2c
commit
e3c57ba369
6 files changed
+20
-55
No files matched your search
+1
-1
@@ -89,7 +89,7 @@ func (d *Direct) dial(network, addr string, localIP net.IP) (net.Conn, error) {
|
||||
c.SetKeepAlive(true)
|
||||
}
|
||||
|
||||
if d.relayTimeout != 0 {
|
||||
if d.relayTimeout > 0 {
|
||||
c.SetDeadline(time.Now().Add(d.relayTimeout))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user