summaryrefslogtreecommitdiff
path: root/Remote/Directory.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Directory.hs')
-rw-r--r--Remote/Directory.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index 40e6dc72d..e23891e5a 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -237,12 +237,13 @@ retrieve d chunksize k f = metered k $ \meterupdate ->
(L.concat <$> mapM L.readFile files)
return True
-retrieveEncrypted :: FilePath -> ChunkSize -> (Cipher, Key) -> FilePath -> Annex Bool
-retrieveEncrypted d chunksize (cipher, enck) f =
- liftIO $ withStoredFiles chunksize d enck $ \files -> catchBoolIO $ do
- withDecryptedContent cipher (L.concat <$> mapM L.readFile files) $
- L.writeFile f
- return True
+retrieveEncrypted :: FilePath -> ChunkSize -> (Cipher, Key) -> Key -> FilePath -> Annex Bool
+retrieveEncrypted d chunksize (cipher, enck) k f = metered k $ \meterupdate ->
+ liftIO $ withStoredFiles chunksize d enck $ \files ->
+ catchBoolIO $ do
+ withDecryptedContent cipher (L.concat <$> mapM L.readFile files) $
+ meteredWriteFile meterupdate f
+ return True
retrieveCheap :: FilePath -> ChunkSize -> Key -> FilePath -> Annex Bool
retrieveCheap _ (Just _) _ _ = return False -- no cheap retrieval for chunks