Skip to content

Commit

Permalink
feat: dfdaemon update content length (#895)
Browse files Browse the repository at this point in the history
* feat: dfdaemon update content length

Signed-off-by: Gaius <[email protected]>

* feat: error check

Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Dec 8, 2021
1 parent ee23dec commit 332c976
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/daemon/peer/peertask_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,13 @@ loop:
pt.Debugf("update digest: %s", pt.md5)
}

// update content length
if piecePacket.ContentLength > 0 {
_ = pt.SetContentLength(piecePacket.ContentLength)
_ = pt.callback.Update(pt)
pt.Debugf("update content length: %d", pt.GetContentLength())
}

// 3. dispatch piece request to all workers
pt.dispatchPieceRequest(pieceRequestCh, piecePacket)

Expand Down

0 comments on commit 332c976

Please sign in to comment.