fixes for transfer resume

Fix resuming of downloads, which do not have a transfer info file to read.

When checking upload progress, use the MVar, rather than re-reading
the info file.

Catch exceptions in the transfer action. Required a tryAnnex.
This commit is contained in:
Joey Hess 2012-09-24 13:16:50 -04:00
parent 364b40e5fc
commit 3887432c54
3 changed files with 34 additions and 20 deletions

View file

@ -47,7 +47,7 @@ start (k:[]) = do
, transferKey = key
}
info <- liftIO $ startTransferInfo file
(update, tfile) <- mkProgressUpdater t info
(update, tfile, _) <- mkProgressUpdater t info
liftIO $ mapM_ void
[ tryIO $ forever $ do
bytes <- readish <$> getLine