projects
/
functorrent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd4a5e2
)
TODO: implement complete/incomplete fields
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Mon, 16 Feb 2015 11:22:05 +0000
(16:52 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Mon, 16 Feb 2015 11:22:05 +0000
(16:52 +0530)
src/Peer.hs
patch
|
blob
|
history
diff --git
a/src/Peer.hs
b/src/Peer.hs
index d30f9b0699e71d1fd3de2ae902ee2918bee2a8bb..020f59690d71313ab429f894cb01afc021efcf3f 100644
(file)
--- 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 = [] }