p <- gets peer
let pieceStatus' = updatePieceAvailability pieceStatus p [idx]
msgLoop pieceStatus' msgchannel
- -- handle RequestMsg. No need to handle PieceMsg here.
- -- also BitFieldMsg
+ _ -> do
+ liftIO $ putStrLn $ ".. not doing anything with the msg"
+ msgLoop pieceStatus msgchannel
+ -- No need to handle PieceMsg and RequestMsg here.
downloadPiece :: Handle -> Integer -> Integer -> IO ByteString