Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1519 from namewxt1220/master
Browse files Browse the repository at this point in the history
修复bug或优化,对已经下载完成的片,客户端再次获得supernode调度后,上报当前片成功的状态。
  • Loading branch information
starnop authored Jan 5, 2021
2 parents 011e011 + d342b03 commit 73b11eb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dfget/core/downloader/p2p_downloader/p2p_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,9 @@ func (p2p *P2PDownloader) processPiece(response *types.PullPieceTaskResponse,
v, ok := p2p.pieceSet[pieceRange]
if ok && v {
alreadyDownload = append(alreadyDownload, pieceRange)
p2p.queue.Put(NewPiece(p2p.taskID,
p2p.node,
pieceTask.Cid,
pieceRange,
constants.ResultSemiSuc,
constants.TaskStatusRunning,
p2p.RegisterResult.CDNSource))
alreadyDownloadedPiece := NewPiece(p2p.taskID, p2p.node, pieceTask.Cid, pieceRange, constants.ResultSemiSuc, constants.TaskStatusRunning, p2p.RegisterResult.CDNSource)
p2p.queue.Put(alreadyDownloadedPiece)
go sendSuccessPiece(p2p.API, p2p.cfg.RV.Cid, alreadyDownloadedPiece, 0, p2p.notifyQueue)
continue
}
if !ok {
Expand Down

0 comments on commit 73b11eb

Please sign in to comment.