X-Git-Url: https://git.rkrishnan.org/?a=blobdiff_plain;f=src%2FFuncTorrent%2FPeer.hs;h=f9fdbc32c45fb6afae5378a6fd425aad68f6ec19;hb=02e7dda4ffa293d3098096635144de3a26fcb124;hp=6c27019634861ac2676a94d970849015ec4258e3;hpb=49d38acf8b3198b1cdf50db2c316638cb5eb02b7;p=functorrent.git diff --git a/src/FuncTorrent/Peer.hs b/src/FuncTorrent/Peer.hs index 6c27019..f9fdbc3 100644 --- a/src/FuncTorrent/Peer.hs +++ b/src/FuncTorrent/Peer.hs @@ -37,8 +37,8 @@ toInt = read getPeerResponse :: ByteString -> PeerResp getPeerResponse body = case decode body of Right (Bdict peerM) -> - let (Just (Bint i)) = lookup (Bstr (pack "interval")) peerM - (Bstr peersBS) = peerM ! Bstr (pack "peers") + let (Just (Bint i)) = lookup "interval" peerM + (Bstr peersBS) = peerM ! "peers" pl = map (\peer -> let (ip', port') = splitAt 4 peer in Peer (toIPNum ip') (toPortNum port')) (splitN 6 peersBS)