diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-15 07:22:38 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-15 07:22:38 +0400 |
commit | f76c503499da778392874195675fba893636ce27 (patch) | |
tree | ab646c7c0f77b28128ae9e0898ce577822575306 /src/Network | |
parent | 7e880e776082177731455842f8bb8a85c2844dc2 (diff) |
Minor changes
Diffstat (limited to 'src/Network')
-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 | {- |