mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-05-02 04:27:34 +08:00
Merge pull request #645 from WankkoRee/pr-close-http-conn
fix: close http connections when each ip test ended
This commit is contained in:
@@ -155,6 +155,7 @@ func downloadHandler(ip *net.IPAddr) (float64, string) {
|
||||
return nil
|
||||
},
|
||||
}
|
||||
defer client.CloseIdleConnections()
|
||||
req, err := http.NewRequest("GET", URL, nil)
|
||||
if err != nil {
|
||||
if utils.Debug { // 调试模式下,输出更多信息
|
||||
|
||||
@@ -37,6 +37,7 @@ func (p *Ping) httping(ip *net.IPAddr) (int, time.Duration, string) {
|
||||
return http.ErrUseLastResponse // 阻止重定向
|
||||
},
|
||||
}
|
||||
defer hc.CloseIdleConnections()
|
||||
|
||||
// 先访问一次获得 HTTP 状态码 及 地区码
|
||||
var colo string
|
||||
|
||||
Reference in New Issue
Block a user