mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-05 16:15:43 +00:00
删除冗余代码
This commit is contained in:
1 parent
d4e1fd23a1
commit
fedf4a60e8
1 file changed
+1
-7
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user