diff options
Diffstat (limited to 'src/Network/Torrent/PWP.hs')
-rw-r--r-- | src/Network/Torrent/PWP.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network/Torrent/PWP.hs b/src/Network/Torrent/PWP.hs index 059dd106..68105947 100644 --- a/src/Network/Torrent/PWP.hs +++ b/src/Network/Torrent/PWP.hs | |||
@@ -13,13 +13,13 @@ data BlockIx = BlockIx { | |||
13 | ixPiece :: {-# UNPACK #-} !Int -- ^ Zero-based piece index. | 13 | ixPiece :: {-# UNPACK #-} !Int -- ^ Zero-based piece index. |
14 | , ixOffset :: {-# UNPACK #-} !Int -- ^ Zero-based byte offset within the piece. | 14 | , ixOffset :: {-# UNPACK #-} !Int -- ^ Zero-based byte offset within the piece. |
15 | , ixLength :: {-# UNPACK #-} !Int -- ^ Block size starting from offset. | 15 | , ixLength :: {-# UNPACK #-} !Int -- ^ Block size starting from offset. |
16 | } deriving (Show, Read, Eq) | 16 | } deriving (Show, Eq) |
17 | 17 | ||
18 | data Block = Block { | 18 | data Block = Block { |
19 | blkPiece :: Int -- ^ Zero-based piece index. | 19 | blkPiece :: Int -- ^ Zero-based piece index. |
20 | , blkOffset :: Int -- ^ Zero-based byte offset within the piece. | 20 | , blkOffset :: Int -- ^ Zero-based byte offset within the piece. |
21 | , blkData :: ByteString -- ^ Payload. | 21 | , blkData :: ByteString -- ^ Payload. |
22 | } deriving (Show, Read, Eq) | 22 | } deriving (Show, Eq) |
23 | 23 | ||
24 | -- TODO comment message constructors | 24 | -- TODO comment message constructors |
25 | data Message = KeepAlive | 25 | data Message = KeepAlive |
@@ -33,7 +33,7 @@ data Message = KeepAlive | |||
33 | | Piece Block | 33 | | Piece Block |
34 | | Cancel BlockIx | 34 | | Cancel BlockIx |
35 | | Port Int | 35 | | Port Int |
36 | deriving (Show, Read, Eq) | 36 | deriving (Show, Eq) |
37 | 37 | ||
38 | getInt :: Get Int | 38 | getInt :: Get Int |
39 | getInt = fromIntegral <$> getWord32be | 39 | getInt = fromIntegral <$> getWord32be |