fix preload size

This commit is contained in:
YouROK
2021-03-08 21:07:49 +03:00
parent 3302ad6371
commit 5c53bbbaa2

View File

@@ -272,6 +272,10 @@ func (t *Torrent) Preload(index int, size int64) {
file = t.Files()[0] file = t.Files()[0]
} }
if size > file.Length() {
size = file.Length()
}
if t.Info() != nil { if t.Info() != nil {
pl := t.Info().PieceLength pl := t.Info().PieceLength
mb5 := int64(5 * 1024 * 1024) mb5 := int64(5 * 1024 * 1024)