From 4d81876bc8ad7fa0ea3177a439104f1c71edd446 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Sat, 27 Feb 2016 14:57:35 +0530 Subject: [PATCH] Peer.hs: handle HaveMsg --- src/FuncTorrent/Peer.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/FuncTorrent/Peer.hs b/src/FuncTorrent/Peer.hs index 05ecc3c..3001018 100644 --- a/src/FuncTorrent/Peer.hs +++ b/src/FuncTorrent/Peer.hs @@ -151,7 +151,11 @@ msgLoop pieceStatus msgchannel = do msgLoop pieceStatus msgchannel PortMsg _ -> msgLoop pieceStatus msgchannel - -- handle RequestMsg, HaveMsg. No need to handle PieceMsg here. + HaveMsg idx -> do + p <- gets peer + let pieceStatus' = updatePieceAvailability pieceStatus p [idx] + msgLoop pieceStatus' msgchannel + -- handle RequestMsg. No need to handle PieceMsg here. -- also BitFieldMsg -- 2.37.2