From: Ramakrishnan Muthukrishnan Date: Fri, 24 Jul 2015 11:04:53 +0000 (+0530) Subject: fix the comments X-Git-Url: https://git.rkrishnan.org/listings//%22news.html/%22?a=commitdiff_plain;h=3bf44f2412b00eb6d4d61467d2fa4171ef330d7c;p=functorrent.git fix the comments --- diff --git a/src/FuncTorrent/Peer.hs b/src/FuncTorrent/Peer.hs index bd44076..6b84666 100644 --- a/src/FuncTorrent/Peer.hs +++ b/src/FuncTorrent/Peer.hs @@ -199,14 +199,16 @@ createDummyFile path size = msgLoop :: PeerState -> PieceMap -> IO () msgLoop state pieceStatus | meInterested state == False && heChoking state == True = do - -- if meInterested and he NOT Choking, pick a piece to download - -- and send a requestmsg. + -- if me NOT Interested and she is Choking, tell her that + -- I am interested. let h = handle state sendMsg h InterestedMsg putStrLn $ "--> InterestedMsg to peer: " ++ show (peer state) msgLoop (state { meInterested = True }) pieceStatus | meInterested state == True && heChoking state == False = + -- if me Interested and she not Choking, send her a request + -- for a piece. case pickPiece pieceStatus of Nothing -> putStrLn "Nothing to download" Just workPiece -> do