Permalink
Browse files

More debug logging.

  • Loading branch information...
1 parent 6d87bc3 commit eb21a63346ad4b175373113bd6eddc090e329398 @jlouis jlouis committed Feb 5, 2010
Showing with 7 additions and 7 deletions.
  1. +5 −6 src/PeerP.hs
  2. +2 −1 src/PieceMgrP.hs
View
11 src/PeerP.hs
@@ -393,8 +393,8 @@ peerP pMgrC pieceMgrC fsC pm logC nPieces h outBound inBound sendBWC statC supC
when (S.member e q)
(do storeBlock n (Block os sz) bs
modify (\s -> s { blockQueue = S.delete e (blockQueue s)}))
- -- When e is not a member, the piece may be stray, so ignore it. Perhaps print something
- -- here.
+ -- When e is not a member, the piece may be stray, so ignore it.
+ -- Perhaps print something here.
cancelMsg n blk =
syncP =<< sendPC outCh (SendQCancel n blk)
considerInterest = do
@@ -407,16 +407,15 @@ peerP pMgrC pieceMgrC fsC pm logC nPieces h outBound inBound sendBWC statC supC
syncP =<< sendPC outCh (SendQMsg Interested)
else modify (\s -> s { weInterested = False})
fillBlocks = do
- choking <- gets peerChoke
- unless choking checkWatermark
+ choked <- gets peerChoke
+ unless choked checkWatermark
checkWatermark = do
q <- gets blockQueue
let sz = S.size q
when (sz < loMark)
(do
- logDebug $ "Filling with " ++ show (hiMark - sz) ++ " pieces..."
toQueue <- grabBlocks (hiMark - sz)
- logDebug $ "Got " ++ show (length toQueue) ++ " blocks"
+ logDebug $ "Got " ++ show (length toQueue) ++ " blocks: " ++ show toQueue
queuePieces toQueue)
queuePieces toQueue = do
mapM_ pushPiece toQueue
View
3 src/PieceMgrP.hs
@@ -135,7 +135,8 @@ start logC mgrC fspC chokeC statC db supC =
logDebug "Grabbed..."
syncP =<< sendP c blocks
StoreBlock pn blk d ->
- do storeBlock pn blk d
+ do logDebug $ "Storing block: " ++ show (pn, blk)
+ storeBlock pn blk d
modify (\s -> s { downloading = downloading s \\ [(pn, blk)] })
handleEndGame pn blk
done <- updateProgress pn blk

0 comments on commit eb21a63

Please sign in to comment.