From: Ramakrishnan Muthukrishnan Date: Thu, 3 Sep 2015 13:42:41 +0000 (+0530) Subject: bug: initial state should be meInterested = false, heChoking = true X-Git-Url: https://git.rkrishnan.org/pf/content/%22news.html/frontends/$top_link?a=commitdiff_plain;h=09d886b5980cf3bee327dcf0b57b5209dcb4237d;p=functorrent.git bug: initial state should be meInterested = false, heChoking = true Otherwise, the "InterestedMsg" never get sent. --- diff --git a/src/FuncTorrent/Peer.hs b/src/FuncTorrent/Peer.hs index cf5b66d..5e23fa1 100644 --- a/src/FuncTorrent/Peer.hs +++ b/src/FuncTorrent/Peer.hs @@ -120,7 +120,7 @@ handlePeerMsgs :: Peer -> Metainfo -> String -> IO () handlePeerMsgs p m peerId = do h <- connectToPeer p doHandshake h p (infoHash m) peerId - let pstate = toPeerState h p False True False True + let pstate = toPeerState h p False False True True pieceHash = pieces (info m) numPieces = (toInteger . (`quot` 20) . BC.length) pieceHash pLen = pieceLength (info m)