summaryrefslogtreecommitdiff
path: root/Remote/Helper/Chunked.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-26 22:25:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-26 22:25:50 -0400
commita566ef1448bf2ad582308ea0d88a9f323aa24f22 (patch)
tree2711a5c39622a2a736e3e26821bc85e9282504d2 /Remote/Helper/Chunked.hs
parente16b1702f9de3fa2e7b4ba160fc8c9b6c318d035 (diff)
fix fallback to other chunk size when first does not have it
Diffstat (limited to 'Remote/Helper/Chunked.hs')
-rw-r--r--Remote/Helper/Chunked.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Remote/Helper/Chunked.hs b/Remote/Helper/Chunked.hs
index 18dfe8aee..baf47f067 100644
--- a/Remote/Helper/Chunked.hs
+++ b/Remote/Helper/Chunked.hs
@@ -221,14 +221,17 @@ hasKeyChunks
-> EncKey
-> Key
-> Annex (Either String Bool)
-hasKeyChunks checker u chunkconfig encryptor basek =
+hasKeyChunks checker u chunkconfig encryptor basek = do
checklists impossible =<< chunkKeys u chunkconfig basek
where
checklists lastfailmsg [] = return $ Left lastfailmsg
checklists _ (l:ls)
- | not (null l) =
- either (`checklists` ls) (return . Right)
- =<< checkchunks l
+ | not (null l) = do
+ v <- checkchunks l
+ case v of
+ Left e -> checklists e ls
+ Right True -> return (Right True)
+ Right False -> checklists impossible ls
| otherwise = checklists impossible ls
checkchunks :: [Key] -> Annex (Either String Bool)