diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-16 15:32:01 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-16 15:32:01 +0400 |
commit | f393a2ec1611d2e5587f6fc97317294377c72d5d (patch) | |
tree | 278edaafd24c59abf480e7be2bb5791c5b527813 /src/Network/BitTorrent/Core | |
parent | 1bfd9cdb74a7ba70c54bf84949889253032f8869 (diff) |
Test peer list encoding
Diffstat (limited to 'src/Network/BitTorrent/Core')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerAddr.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs index c9ec6b96..6c6056c9 100644 --- a/src/Network/BitTorrent/Core/PeerAddr.hs +++ b/src/Network/BitTorrent/Core/PeerAddr.hs | |||
@@ -154,11 +154,11 @@ instance (Typeable a, BEncode a) => BEncode (PeerAddr a) where | |||
154 | .: endDict | 154 | .: endDict |
155 | 155 | ||
156 | fromBEncode = fromDict $ do | 156 | fromBEncode = fromDict $ do |
157 | peerAddr <$>? peer_id_key | 157 | peerAddr <$>! peer_ip_key |
158 | <*>! peer_ip_key | 158 | <*>? peer_id_key |
159 | <*>! peer_port_key | 159 | <*>! peer_port_key |
160 | where | 160 | where |
161 | peerAddr ip pid port = PeerAddr ip pid port | 161 | peerAddr = flip PeerAddr |
162 | 162 | ||
163 | mergeIPLists :: [PeerAddr IPv4] -> Maybe [PeerAddr IPv6] -> [PeerAddr IP] | 163 | mergeIPLists :: [PeerAddr IPv4] -> Maybe [PeerAddr IPv6] -> [PeerAddr IP] |
164 | mergeIPLists v4 v6 = (fmap IPv4 `L.map` v4) | 164 | mergeIPLists v4 v6 = (fmap IPv4 `L.map` v4) |