Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
xxf098 committed Feb 16, 2021
1 parent 5e1e096 commit 1b42d51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion download/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Download(link string, timeout time.Duration, resultChan chan<- int64) (int6
func downloadInternal(ctx context.Context, url string, timeout time.Duration, resultChan chan<- int64, dial func(network, addr string) (net.Conn, error)) (int64, error) {
var max int64 = 0
httpTransport := &http.Transport{}
httpClient := &http.Client{Transport: httpTransport}
httpClient := &http.Client{Transport: httpTransport, Timeout: timeout}
if dial != nil {
httpTransport.Dial = dial
}
Expand Down

0 comments on commit 1b42d51

Please sign in to comment.