mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-16 13:06:40 +00:00
internal/download: show progress bar only if server gives length (#33842)
Fixes this: https://ci.appveyor.com/project/ethereum/go-ethereum/builds/53538177/job/ptosr48pvvwkjskb#L43
This commit is contained in:
parent
c50e5edfaf
commit
ad88b68a46
1 changed files with 4 additions and 1 deletions
|
|
@ -205,7 +205,10 @@ func (db *ChecksumDB) DownloadFile(url, dstPath string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
dst := newDownloadWriter(fd, resp.ContentLength)
|
var dst io.WriteCloser = fd
|
||||||
|
if resp.ContentLength > 0 {
|
||||||
|
dst = newDownloadWriter(fd, resp.ContentLength)
|
||||||
|
}
|
||||||
_, err = io.Copy(dst, resp.Body)
|
_, err = io.Copy(dst, resp.Body)
|
||||||
dst.Close()
|
dst.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue