mirror of
https://github.com/nadoo/glider.git
synced 2026-11-23 23:49:41 +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
@@ -256,7 +256,9 @@ func checkWebSite(fwdr *Forwarder, website string, timeout time.Duration, buf []
|
||||
}
|
||||
defer rc.Close()
|
||||
|
||||
rc.SetDeadline(time.Now().Add(timeout))
|
||||
if timeout > 0 {
|
||||
rc.SetDeadline(time.Now().Add(timeout))
|
||||
}
|
||||
|
||||
_, err = rc.Write([]byte("GET / HTTP/1.0\r\n\r\n"))
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user