diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-18 18:27:53 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-18 18:27:53 -0400 |
commit | ac71b499ac6d53408cfce19a1ddd00bfa4b2645f (patch) | |
tree | 8edf701de6ee4a7fae691743e87ac1f5f6e78b25 /Remote/WebDAV.hs | |
parent | 677aab525a7023642f4b2e9d96db3c3481e8f0b1 (diff) |
simplify
Diffstat (limited to 'Remote/WebDAV.hs')
-rw-r--r-- | Remote/WebDAV.hs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs index ea4800c9d..ed7b82b64 100644 --- a/Remote/WebDAV.hs +++ b/Remote/WebDAV.hs @@ -116,19 +116,15 @@ retrieve :: Remote -> Key -> AssociatedFile -> FilePath -> Annex Bool retrieve r k _f d = metered Nothing k $ \meterupdate -> davAction r False $ \(baseurl, user, pass) -> liftIO $ catchBoolIO $ withStoredFiles r k baseurl user pass onerr $ \urls -> do - meteredWriteFileChunks meterupdate d urls $ - feeder user pass + meteredWriteFileChunks meterupdate d urls $ \url -> do + mb <- davGetUrlContent url user pass + case mb of + Nothing -> throwIO "download failed" + Just b -> return b return True where onerr _ = return False - feeder _ _ [] = return ([], []) - feeder user pass (url:urls) = do - mb <- davGetUrlContent url user pass - case mb of - Nothing -> throwIO "download failed" - Just b -> return (urls, L.toChunks b) - retrieveEncrypted :: Remote -> (Cipher, Key) -> Key -> FilePath -> Annex Bool retrieveEncrypted r (cipher, enck) k d = metered Nothing k $ \meterupdate -> davAction r False $ \(baseurl, user, pass) -> liftIO $ catchBoolIO $ |