more generic clientGet

This commit is contained in:
Joey Hess 2024-07-24 11:10:19 -04:00
parent 10f2c23fd7
commit 5b1ac1a313
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 10 additions and 14 deletions

View file

@ -583,7 +583,9 @@ copyFromRemote'' repo r st@(State connpool _ _ _ _) key af dest meterupdate vc
Just startsz' -> liftIO $ do
resumeVerifyFromOffset startsz' iv p h
_ -> return p
p2pHttpClient r giveup (clientGet p' iv key af h startsz) >>= \case
let consumer = meteredWrite' p'
(writeVerifyChunk iv h)
p2pHttpClient r giveup (clientGet key af consumer startsz) >>= \case
Valid -> return ()
Invalid -> giveup "Transfer failed"