diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-26 15:03:12 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-26 15:03:12 -0400 |
commit | 691958612b7b59cfd99a694b34fc1986f84eaa2e (patch) | |
tree | 28d89d004ac42013cea001ae8eea9780f0ef765a /Remote/WebDAV.hs | |
parent | 618e3ae6364bbcade9d7bb657412418967ae4143 (diff) |
directory, webdav: Fix bug introduced in version 4.20131002 that caused the chunkcount file to not be written. Work around repositories without such a file, so files can still be retreived from them.
Diffstat (limited to 'Remote/WebDAV.hs')
-rw-r--r-- | Remote/WebDAV.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs index c65118efb..1a722f147 100644 --- a/Remote/WebDAV.hs +++ b/Remote/WebDAV.hs @@ -198,8 +198,14 @@ withStoredFiles withStoredFiles r k baseurl user pass onerr a | isJust $ chunkSize $ config r = do let chunkcount = keyurl ++ chunkCount - maybe (onerr chunkcount) (a . listChunks keyurl . L8.toString) - =<< davGetUrlContent chunkcount user pass + v <- davGetUrlContent chunkcount user pass + case v of + Just s -> a $ listChunks keyurl $ L8.toString s + Nothing -> do + chunks <- probeChunks keyurl $ \u -> (== Right True) <$> davUrlExists u user pass + if null chunks + then onerr chunkcount + else a chunks | otherwise = a [keyurl] where keyurl = davLocation baseurl k ++ keyFile k |