use TotalSize more extensively

This commit is contained in:
Joey Hess 2020-12-11 12:03:40 -04:00
parent 263fd1d459
commit 94b323a8e8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 48 additions and 35 deletions

View file

@ -281,7 +281,7 @@ data LocalF c
-- present, runs the protocol action with False.
| WaitRefChange (ChangedRefs -> c)
-- ^ Waits for one or more git refs to change and returns them.a
| UpdateMeterTotalSize Meter Integer c
| UpdateMeterTotalSize Meter TotalSize c
-- ^ Updates the total size of a Meter, for cases where the size is
-- not known until the data is being received.
| RunValidityCheck (Annex Validity) (Validity -> c)
@ -548,7 +548,7 @@ receiveContent mm p sizer storer mkmsg = do
Just (DATA len@(Len l)) -> do
local $ case mm of
Nothing -> return ()
Just m -> updateMeterTotalSize m (n+l)
Just m -> updateMeterTotalSize m (TotalSize (n+l))
ver <- net getProtocolVersion
let validitycheck = if ver >= ProtocolVersion 1
then net receiveMessage >>= \case