diff options
Diffstat (limited to 'src/Network/BitTorrent/Exchange.hs')
-rw-r--r-- | src/Network/BitTorrent/Exchange.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange.hs b/src/Network/BitTorrent/Exchange.hs index b2d639f6..dc1b2752 100644 --- a/src/Network/BitTorrent/Exchange.hs +++ b/src/Network/BitTorrent/Exchange.hs | |||
@@ -464,16 +464,15 @@ exchange :: Storage -> P2P () | |||
464 | exchange storage = {-# SCC exchange #-} awaitEvent >>= handler | 464 | exchange storage = {-# SCC exchange #-} awaitEvent >>= handler |
465 | where | 465 | where |
466 | handler (Available bf) = do | 466 | handler (Available bf) = do |
467 | liftIO $ print (completeness bf) | ||
468 | ixs <- selBlk (findMin bf) storage | 467 | ixs <- selBlk (findMin bf) storage |
469 | mapM_ (yieldEvent . Want) ixs -- TODO yield vectored | 468 | mapM_ (yieldEvent . Want) ixs -- TODO yield vectored |
470 | 469 | ||
471 | handler (Want bix) = do | 470 | handler (Want bix) = do |
471 | liftIO $ print bix | ||
472 | blk <- liftIO $ getBlk bix storage | 472 | blk <- liftIO $ getBlk bix storage |
473 | yieldEvent (Fragment blk) | 473 | yieldEvent (Fragment blk) |
474 | 474 | ||
475 | handler (Fragment blk @ Block {..}) = do | 475 | handler (Fragment blk @ Block {..}) = do |
476 | liftIO $ print (ppBlock blk) | ||
477 | done <- liftIO $ putBlk blk storage | 476 | done <- liftIO $ putBlk blk storage |
478 | when done $ do | 477 | when done $ do |
479 | yieldEvent $ Available $ singleton blkPiece (succ blkPiece) | 478 | yieldEvent $ Available $ singleton blkPiece (succ blkPiece) |