summaryrefslogtreecommitdiff
path: root/Command/TransferInfo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/TransferInfo.hs')
-rw-r--r--Command/TransferInfo.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Command/TransferInfo.hs b/Command/TransferInfo.hs
index aacc69bb1..4bebdebcd 100644
--- a/Command/TransferInfo.hs
+++ b/Command/TransferInfo.hs
@@ -13,6 +13,7 @@ import Annex.Content
import Logs.Transfer
import Types.Key
import qualified Fields
+import Utility.Metered
def :: [Command]
def = [noCommit $ command "transferinfo" paramKey seek SectionPlumbing
@@ -50,10 +51,14 @@ start (k:[]) = do
(update, tfile, _) <- mkProgressUpdater t info
liftIO $ mapM_ void
[ tryIO $ forever $ do
- bytes <- readish <$> getLine
- maybe (error "transferinfo protocol error") update bytes
+ bytes <- readUpdate
+ maybe (error "transferinfo protocol error")
+ (update . toBytesProcessed) bytes
, tryIO $ removeFile tfile
, exitSuccess
]
stop
start _ = error "wrong number of parameters"
+
+readUpdate :: IO (Maybe Integer)
+readUpdate = readish <$> getLine