This commit is contained in:
Matt Joiner 2018-01-25 17:43:33 +11:00
parent 95d535032e
commit 692facdebb
1 changed files with 2 additions and 0 deletions

View File

@ -222,6 +222,8 @@ func (r *reader) readOnceAt(b []byte, pos int64, ctxErr *error) (n int, err erro
return return
} }
r.t.cl.mu.Lock() r.t.cl.mu.Lock()
// TODO: Just reset pieces in the readahead window. This might help
// prevent thrashing with small caches and file and piece priorities.
log.Printf("error reading torrent %q piece %d offset %d, %d bytes: %s", r.t, pi, po, len(b1), err) log.Printf("error reading torrent %q piece %d offset %d, %d bytes: %s", r.t, pi, po, len(b1), err)
r.t.updateAllPieceCompletions() r.t.updateAllPieceCompletions()
r.t.updateAllPiecePriorities() r.t.updateAllPiecePriorities()