update http

This commit is contained in:
影舞者 2022-01-07 16:54:23 +08:00
parent dbb6f43fc1
commit 205021afec
2 changed files with 2 additions and 3 deletions

View File

@ -40,7 +40,7 @@ func InitHttpClient(ThreadsNum int, DownProxy string, Timeout time.Duration) err
IdleConnTimeout: keepAlive,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSHandshakeTimeout: 5 * time.Second,
DisableKeepAlives: false,
DisableKeepAlives: true,
}
if DownProxy != "" {
if DownProxy == "1" {

View File

@ -591,9 +591,8 @@ func getRespBody(oResp *http.Response) ([]byte, error) {
body = append(body, buf...)
}
} else {
raw, err := ioutil.ReadAll(oResp.Body)
raw, err := ioutil.ReadAll(io.LimitReader(oResp.Body, int64(3<<20)))
if err != nil {
//utils.Logger.Error(err)
return nil, err
}
defer oResp.Body.Close()