diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Assembler.hs | 14 |
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 | ||
78 | type Timestamp = () | ||
79 | {- | ||
80 | data BlockRequest = BlockRequest | ||
81 | { requestSent :: Timestamp | ||
82 | , requestedPeer :: PeerAddr IP | ||
83 | , requestedBlock :: BlockIx | ||
84 | } | ||
85 | -} | ||
78 | type BlockRange = (BlockOffset, BlockSize) | 86 | type BlockRange = (BlockOffset, BlockSize) |
79 | type PieceMap = IntMap | 87 | type 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. |
127 | insert :: (PeerAddr IP) -> Block a -> Assembler -> Assembler | 135 | insert :: PeerAddr IP -> Block a -> Assembler -> Assembler |
128 | insert = undefined | 136 | insert = undefined |
129 | 137 | ||
130 | {- | 138 | {- |