This commit is contained in:
TenderIronh
2026-04-01 15:33:30 +08:00
parent ef4bc1e1e3
commit 12393f00c5
23 changed files with 1047 additions and 383 deletions
+3 -3
View File
@@ -9,7 +9,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
@@ -49,7 +48,7 @@ func update(host string, port int) error {
gLog.e("get update info error:%s", rsp.Status)
return err
}
rspBuf, err := ioutil.ReadAll(rsp.Body)
rspBuf, err := io.ReadAll(rsp.Body)
if err != nil {
gLog.e("update:read update list failed:%s", err)
return err
@@ -94,7 +93,8 @@ func downloadFile(url string, checksum string, dstFile string) error {
RootCAs: caCertPool,
InsecureSkipVerify: gConf.TLSInsecureSkipVerify},
}
client := &http.Client{Transport: tr}
client := &http.Client{Transport: tr,
Timeout: 60 * time.Second}
response, err := client.Get(url)
if err != nil {
gLog.e("download url %s error:%s", url, err)