TorrentReadAt shouldn't care about verification state
This commit is contained in:
parent
dd30d144ae
commit
763e387c62
@ -132,13 +132,6 @@ func (cl *Client) TorrentReadAt(ih InfoHash, off int64, p []byte) (n int, err er
|
|||||||
}
|
}
|
||||||
t.lastReadPiece = int(index)
|
t.lastReadPiece = int(index)
|
||||||
piece := t.Pieces[index]
|
piece := t.Pieces[index]
|
||||||
if !piece.EverHashed {
|
|
||||||
cl.queuePieceCheck(t, index)
|
|
||||||
}
|
|
||||||
if piece.Hashing {
|
|
||||||
err = ErrDataNotReady
|
|
||||||
return
|
|
||||||
}
|
|
||||||
pieceOff := pp.Integer(off % int64(t.PieceLength(0)))
|
pieceOff := pp.Integer(off % int64(t.PieceLength(0)))
|
||||||
high := int(t.PieceLength(index) - pieceOff)
|
high := int(t.PieceLength(index) - pieceOff)
|
||||||
if high < len(p) {
|
if high < len(p) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user