diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-01-11 08:49:40 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-01-11 08:49:40 +0400 |
commit | b8f976b3df0af5d27f926022d7c7624609fc1072 (patch) | |
tree | 0d6b4d23d9ae87aacb4991dac0f7e4607738f551 /src/Network/BitTorrent/DHT/Message.hs | |
parent | 353c25a17d4100afd23127fc32d96995a9c70388 (diff) |
Add documentation to peer store section
Diffstat (limited to 'src/Network/BitTorrent/DHT/Message.hs')
-rw-r--r-- | src/Network/BitTorrent/DHT/Message.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/DHT/Message.hs b/src/Network/BitTorrent/DHT/Message.hs index acecf8b1..7bcd00f0 100644 --- a/src/Network/BitTorrent/DHT/Message.hs +++ b/src/Network/BitTorrent/DHT/Message.hs | |||
@@ -73,6 +73,7 @@ module Network.BitTorrent.DHT.Message | |||
73 | , NodeFound (..) | 73 | , NodeFound (..) |
74 | 74 | ||
75 | -- ** get_peers | 75 | -- ** get_peers |
76 | , PeerList | ||
76 | , GetPeers (..) | 77 | , GetPeers (..) |
77 | , GotPeers (..) | 78 | , GotPeers (..) |
78 | 79 | ||
@@ -216,11 +217,13 @@ instance BEncode GetPeers where | |||
216 | toBEncode (GetPeers ih) = toDict $ info_hash_key .=! ih .: endDict | 217 | toBEncode (GetPeers ih) = toDict $ info_hash_key .=! ih .: endDict |
217 | fromBEncode = fromDict $ GetPeers <$>! info_hash_key | 218 | fromBEncode = fromDict $ GetPeers <$>! info_hash_key |
218 | 219 | ||
220 | type PeerList ip = Either [NodeInfo ip] [PeerAddr ip] | ||
221 | |||
219 | data GotPeers ip = GotPeers | 222 | data GotPeers ip = GotPeers |
220 | { -- | If the queried node has no peers for the infohash, returned | 223 | { -- | If the queried node has no peers for the infohash, returned |
221 | -- the K nodes in the queried nodes routing table closest to the | 224 | -- the K nodes in the queried nodes routing table closest to the |
222 | -- infohash supplied in the query. | 225 | -- infohash supplied in the query. |
223 | peers :: Either [NodeInfo ip] [PeerAddr ip] | 226 | peers :: PeerList ip |
224 | 227 | ||
225 | -- | The token value is a required argument for a future | 228 | -- | The token value is a required argument for a future |
226 | -- announce_peer query. | 229 | -- announce_peer query. |