summaryrefslogtreecommitdiff
path: root/src/System/Torrent
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-12-14 22:43:23 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-12-14 22:43:23 +0400
commitc7d84e12184430062305d1d4677a90df558484ea (patch)
tree2c7d21e27039938adb1f734e2d1f04307d577b15 /src/System/Torrent
parent01d48a9dc7d32869cff59369e6b4968473a49456 (diff)
Add stub for hintRead function
Diffstat (limited to 'src/System/Torrent')
-rw-r--r--src/System/Torrent/Storage.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/System/Torrent/Storage.hs b/src/System/Torrent/Storage.hs
index 8ad4d3e5..214998a9 100644
--- a/src/System/Torrent/Storage.hs
+++ b/src/System/Torrent/Storage.hs
@@ -34,6 +34,7 @@ module System.Torrent.Storage
34 -- * Modification 34 -- * Modification
35 , writePiece 35 , writePiece
36 , readPiece 36 , readPiece
37 , hintRead
37 , unsafeReadPiece 38 , unsafeReadPiece
38 ) where 39 ) where
39 40
@@ -103,6 +104,10 @@ readPiece pix s @ Storage {..}
103 offset = fromIntegral pix * fromIntegral pieceLen 104 offset = fromIntegral pix * fromIntegral pieceLen
104 sz = fromIntegral pieceLen 105 sz = fromIntegral pieceLen
105 106
107-- | Hint about the coming 'readPiece'.
108hintRead :: PieceIx -> Storage -> IO ()
109hintRead _pix Storage {..} = return ()
110
106unsafeReadPiece :: PieceIx -> Storage -> IO (Piece BL.ByteString) 111unsafeReadPiece :: PieceIx -> Storage -> IO (Piece BL.ByteString)
107unsafeReadPiece pix s @ Storage {..} 112unsafeReadPiece pix s @ Storage {..}
108 | not (isValidIx pix s) = throwIO (InvalidIndex pix) 113 | not (isValidIx pix s) = throwIO (InvalidIndex pix)