-- and send a requestmsg.
let isMeInterested = meInterested state
isHeChoking = heChoking state
- if (isMeInterested && isHeChoking)
+ if (not isMeInterested && isHeChoking)
then
do
let h = handle state
sendMsg h InterestedMsg
putStrLn $ "--> InterestedMsg to peer: " ++ show (peer state)
- msgLoop state pieceStatus
+ msgLoop (state { meInterested = True }) pieceStatus
else
do
msg <- getMsg (handle state)
-- download each of the piece in order
msgLoop state pieceStatus'
UnChokeMsg -> do
- msgLoop (state {heChoking = False}) pieceStatus
+ msgLoop (state { heChoking = False }) pieceStatus
_ -> do
msgLoop state pieceStatus