diff --git a/main.go b/main.go index f11ac8e..fe95c0b 100644 --- a/main.go +++ b/main.go @@ -138,10 +138,6 @@ func main() { var data_2 = make([]CloudflareIPData, 0) downloadTestTime = time.Duration(downloadSecond) * time.Second - //println(downloadTestCount) - //println(downloadTestTime) - //println(downloadSecond) - fmt.Println("# XIU2/CloudflareSpeedTest " + version + "\n") if ipv6Mode { fmt.Println("开始延迟测速(模式:TCP IPv6,端口:" + strconv.Itoa(tcpPort) + "):") diff --git a/tcping.go b/tcping.go index f941abf..8d37e53 100644 --- a/tcping.go +++ b/tcping.go @@ -112,7 +112,7 @@ func DownloadSpeedHandler(ip net.IPAddr) (bool, float32) { Transport: nil, CheckRedirect: nil, Jar: nil, - Timeout: 0, + Timeout: downloadTestTime, } var fullAddress string if ipv6Mode { // IPv6 需要加上 [] @@ -124,7 +124,6 @@ func DownloadSpeedHandler(ip net.IPAddr) (bool, float32) { DialContext: GetDialContextByAddr(fullAddress), } response, err := client.Get(url) - if err != nil { return false, 0 } else {