return (Right res)
where
stream h checkv checkresultv = S.SourceT $ \a -> do
- bl <- L.hGetContents h
+ bl <- hGetContentsMetered h meterupdate
v <- newMVar (0, filter (not . B.null) (L.toChunks bl))
a (go v)
where
import qualified Remote.GitLFS
import qualified Remote.P2P
import qualified Remote.Helper.P2P as P2PHelper
+import qualified P2P.Protocol as P2P
import P2P.Address
import P2P.Http.Url
import P2P.Http.Client
return False
Nothing -> return True
in p2pHttpClient r (const $ pure $ PutOffsetResultPlus (Offset 0)) (clientPutOffset key) >>= \case
- PutOffsetResultPlus offset ->
+ PutOffsetResultPlus (offset@(Offset (P2P.Offset n))) ->
metered (Just meterupdate) key bwlimit $ \_ p -> do
+ let p' = offsetMeterUpdate p (BytesProcessed n)
res <- p2pHttpClient r giveup $
- clientPut p key (Just offset) af object sz check'
+ clientPut p' key (Just offset) af object sz check'
case res of
PutResultPlus False _ ->
failedsend
## work notes
-* Rest of Remote.Git needs implementing: put, drop, lock
+* Rest of Remote.Git needs implementing: drop, lock
* A Locker should expire the lock on its own after 10 minutes,
initially. Once keeplocked is called, the expiry should end with the end