From: Ramakrishnan Muthukrishnan Date: Mon, 16 Feb 2015 11:22:05 +0000 (+0530) Subject: TODO: implement complete/incomplete fields X-Git-Url: https://git.rkrishnan.org/%5B/frontends/flags/%22file:/%22doc.html//%22%22.?a=commitdiff_plain;h=476f99bd64e2bef671310f2a414b81383260fb2f;p=functorrent.git TODO: implement complete/incomplete fields --- diff --git a/src/Peer.hs b/src/Peer.hs index d30f9b0..020f596 100644 --- a/src/Peer.hs +++ b/src/Peer.hs @@ -14,6 +14,8 @@ data Peer = Peer { ip :: String data PeerResp = PeerResponse { interval :: Maybe Integer , peers :: [Peer] + , complete :: Maybe Integer + , incomplete :: Maybe Integer } deriving (Show) toInt :: String -> Integer @@ -37,4 +39,4 @@ getPeerResponse body = case (Benc.decode body) of toIPNum = (L.intercalate ".") . map (show . toInt . ("0x" ++) . BC.unpack) . (U.splitN 2) . B16.encode - Left _ -> PeerResponse { interval = Nothing, peers = [] } + Left _ -> PeerResponse { peers = [] }