Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/file.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/file.js b/lib/file.js
index e5624cd..8bcfe22 100644
--- a/lib/file.js
+++ b/lib/file.js
@@ -43,7 +43,7 @@ class File extends EventEmitter {
// Calculate first piece diffrently, it sometimes have a offset
let downloaded = bitfield.get(start)
- ? pieceLength - this.offset
+ ? pieceLength - (this.offset % pieceLength)
: Math.max(piece.length - piece.missing - this.offset, 0)
for (let index = start + 1; index <= end; ++index) {