summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-25 15:29:21 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-25 15:29:21 +0400
commit627b44ab54111322eeb273de87c6d8a24d7f37c1 (patch)
tree65396d24977de856df49ba4803387fdfdf15c976 /src
parent7627d4dda31ddbececa4c80b340026da9e06c80e (diff)
Use PieceSize then appropriate
Diffstat (limited to 'src')
-rw-r--r--src/Network/BitTorrent/Exchange/Message.hs2
-rw-r--r--src/Network/BitTorrent/Exchange/Session/Metadata.hs3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange/Message.hs b/src/Network/BitTorrent/Exchange/Message.hs
index 7748f843..d8873f95 100644
--- a/src/Network/BitTorrent/Exchange/Message.hs
+++ b/src/Network/BitTorrent/Exchange/Message.hs
@@ -864,7 +864,7 @@ instance PeerMessage ExtendedMetadata where
864 864
865-- | All 'Piece's in 'MetadataData' messages MUST have size equal to 865-- | All 'Piece's in 'MetadataData' messages MUST have size equal to
866-- this value. The last trailing piece can be shorter. 866-- this value. The last trailing piece can be shorter.
867metadataPieceSize :: Int 867metadataPieceSize :: P.PieceSize
868metadataPieceSize = 16 * 1024 868metadataPieceSize = 16 * 1024
869 869
870isLastPiece :: P.Piece a -> Int -> Bool 870isLastPiece :: P.Piece a -> Int -> Bool
diff --git a/src/Network/BitTorrent/Exchange/Session/Metadata.hs b/src/Network/BitTorrent/Exchange/Session/Metadata.hs
index 7e14f493..174550fa 100644
--- a/src/Network/BitTorrent/Exchange/Session/Metadata.hs
+++ b/src/Network/BitTorrent/Exchange/Session/Metadata.hs
@@ -38,7 +38,8 @@ data Status = Status
38 38
39makeLenses ''Status 39makeLenses ''Status
40 40
41nullStatus :: PieceSize -> Status 41-- | Create a new scheduler for infodict of the given size.
42nullStatus :: Int -> Status
42nullStatus ps = Status [] (Block.empty ps) 43nullStatus ps = Status [] (Block.empty ps)
43 44
44type Updates a = State Status a 45type Updates a = State Status a