diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-27 18:52:42 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-27 18:56:32 -0400 |
commit | f6e7037c0ccdf646d1ca955c48cece814f5700a4 (patch) | |
tree | 035070a47d5bac76e36271507a09aea23ef3ee12 /Remote/Helper/ChunkedEncryptable.hs | |
parent | 300935948503d671ad91b943787d71dc1f6e421e (diff) |
resume interrupted chunked downloads
Leverage the new chunked remotes to automatically resume downloads.
Sort of like rsync, although of course not as efficient since this
needs to start at a chunk boundry.
But, unlike rsync, this method will work for S3, WebDAV, external
special remotes, etc, etc. Only directory special remotes so far,
but many more soon!
This implementation will also properly handle starting a download
from one remote, interrupting, and resuming from another one, and so on.
(Resuming interrupted chunked uploads is similarly doable, although
slightly more expensive.)
This commit was sponsored by Thomas Djärv.
Diffstat (limited to 'Remote/Helper/ChunkedEncryptable.hs')
-rw-r--r-- | Remote/Helper/ChunkedEncryptable.hs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Remote/Helper/ChunkedEncryptable.hs b/Remote/Helper/ChunkedEncryptable.hs index ac8917851..66e02da12 100644 --- a/Remote/Helper/ChunkedEncryptable.hs +++ b/Remote/Helper/ChunkedEncryptable.hs @@ -103,9 +103,7 @@ chunkedEncryptableRemote c preparestorer prepareretriever r = encr safely $ prepareretriever k $ safely . go where go (Just retriever) = metered (Just p) k $ \p' -> - bracketIO (openBinaryFile dest WriteMode) hClose $ \h -> - retrieveChunks retriever (uuid r) chunkconfig enck k p' $ - sink h + retrieveChunks retriever (uuid r) chunkconfig enck k dest p' sink go Nothing = return False sink h p' b = do let write = meteredWrite p' h |