summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/PeerWire/Block.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/PeerWire/Block.hs')
-rw-r--r--src/Network/BitTorrent/PeerWire/Block.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/PeerWire/Block.hs b/src/Network/BitTorrent/PeerWire/Block.hs
index 582accdb..fbc65338 100644
--- a/src/Network/BitTorrent/PeerWire/Block.hs
+++ b/src/Network/BitTorrent/PeerWire/Block.hs
@@ -1,5 +1,7 @@
1module Network.BitTorrent.PeerWire.Block 1module Network.BitTorrent.PeerWire.Block
2 ( BlockIx(..), Block(..), PieceIx 2 ( BlockIx(..)
3 , Block(..), blockSize
4 , PieceIx
3 , BlockLIx, PieceLIx 5 , BlockLIx, PieceLIx
4 , defaultBlockSize 6 , defaultBlockSize
5 , pieceIx, blockIx 7 , pieceIx, blockIx
@@ -68,6 +70,9 @@ data Block = Block {
68ppBlock :: Block -> String 70ppBlock :: Block -> String
69ppBlock = ppBlockIx . blockIx 71ppBlock = ppBlockIx . blockIx
70 72
73blockSize :: Block -> Int
74blockSize blk = B.length (blkData blk)
75
71-- | Widely used semi-official block size. 76-- | Widely used semi-official block size.
72defaultBlockSize :: Int 77defaultBlockSize :: Int
73defaultBlockSize = 16 * 1024 78defaultBlockSize = 16 * 1024