From fedf4a60e8bbc085da858a72d9cc55c2ec8c7327 Mon Sep 17 00:00:00 2001 From: liwei Date: Thu, 20 Aug 2020 22:24:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- download/http/process.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/download/http/process.go b/download/http/process.go index 4d36ca0a..414e41a0 100644 --- a/download/http/process.go +++ b/download/http/process.go @@ -43,7 +43,6 @@ func (p *Process) Start() error { } defer p.close() p.status = common.DownloadStatusStart - var fetchErr error if p.res.Range { // 每个连接平均需要下载的分块大小 chunkSize := p.res.Size / int64(p.opts.Connections) @@ -63,18 +62,13 @@ func (p *Process) Start() error { chunk := model.NewChunk(begin, end) p.chunks[i] = chunk } - fetchErr = p.fetch() } else { // 只支持单连接下载 p.chunks = make([]*model.Chunk, 1) p.clients = make([]*http.Response, 1) p.chunks[0] = model.NewChunk(0, 0) - fetchErr = p.fetch() } - if fetchErr != nil && fetchErr != common.PauseErr { - p.Pause() - } - return fetchErr + return p.fetch() } func (p *Process) Pause() error {