Peer: catchall case statement to catch any invalid msgs
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 27 Feb 2016 11:57:42 +0000 (17:27 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 27 Feb 2016 11:57:42 +0000 (17:27 +0530)
src/FuncTorrent/Peer.hs

index 3e16254a53c84f618bce0d569e2bfe4a03af4e78..9dd307d45c7a68898768d5b0c320440ed6409f6e 100644 (file)
@@ -155,8 +155,10 @@ msgLoop pieceStatus msgchannel = do
           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