Skip to content

Commit

Permalink
Only count correctly received picture chunks. Addresses Issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Merrony committed Feb 12, 2019
1 parent 401f34d commit 5da7ccd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tello.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ func (tello *Tello) controlResponseListener() {
if !already {
tello.fileTemp.pieces[thisChunk.pieceNum].chunks = append(tello.fileTemp.pieces[thisChunk.pieceNum].chunks, thisChunk)
tello.fileTemp.accumSize += len(thisChunk.chunkData)
tello.fileTemp.pieces[thisChunk.pieceNum].numChunks++
}
}
tello.fileTemp.pieces[thisChunk.pieceNum].numChunks++
tello.fdMu.Unlock()
if tello.fileTemp.pieces[thisChunk.pieceNum].numChunks == 8 {
// piece has 8 chunks, it's complete
Expand Down

0 comments on commit 5da7ccd

Please sign in to comment.