summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-15 07:22:38 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-15 07:22:38 +0400
commitf76c503499da778392874195675fba893636ce27 (patch)
treeab646c7c0f77b28128ae9e0898ce577822575306 /src/Network
parent7e880e776082177731455842f8bb8a85c2844dc2 (diff)
Minor changes
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent/Exchange/Assembler.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/Exchange/Assembler.hs b/src/Network/BitTorrent/Exchange/Assembler.hs
index aa009f49..e5834948 100644
--- a/src/Network/BitTorrent/Exchange/Assembler.hs
+++ b/src/Network/BitTorrent/Exchange/Assembler.hs
@@ -51,9 +51,9 @@ module Network.BitTorrent.Exchange.Assembler
51 , Network.BitTorrent.Exchange.Assembler.null 51 , Network.BitTorrent.Exchange.Assembler.null
52 , Network.BitTorrent.Exchange.Assembler.size 52 , Network.BitTorrent.Exchange.Assembler.size
53 53
54 -- * Construction 54 -- *
55 , Network.BitTorrent.Exchange.Assembler.empty 55 , Network.BitTorrent.Exchange.Assembler.empty
56 , Network.BitTorrent.Exchange.Assembler.allowPiece 56 , allowPiece
57 57
58 -- * Debugging 58 -- * Debugging
59 , Network.BitTorrent.Exchange.Assembler.valid 59 , Network.BitTorrent.Exchange.Assembler.valid
@@ -75,6 +75,14 @@ import Network.BitTorrent.Exchange.Block as B
75-- Assembler 75-- Assembler
76-----------------------------------------------------------------------} 76-----------------------------------------------------------------------}
77 77
78type Timestamp = ()
79{-
80data BlockRequest = BlockRequest
81 { requestSent :: Timestamp
82 , requestedPeer :: PeerAddr IP
83 , requestedBlock :: BlockIx
84 }
85-}
78type BlockRange = (BlockOffset, BlockSize) 86type BlockRange = (BlockOffset, BlockSize)
79type PieceMap = IntMap 87type PieceMap = IntMap
80 88
@@ -124,7 +132,7 @@ allowedSet = undefined
124-- You should check if a returned by peer block is actually have 132-- You should check if a returned by peer block is actually have
125-- been requested and in-flight. This is needed to avoid "I send 133-- been requested and in-flight. This is needed to avoid "I send
126-- random corrupted block" attacks. 134-- random corrupted block" attacks.
127insert :: (PeerAddr IP) -> Block a -> Assembler -> Assembler 135insert :: PeerAddr IP -> Block a -> Assembler -> Assembler
128insert = undefined 136insert = undefined
129 137
130{- 138{-