summaryrefslogtreecommitdiff
path: root/Remote/WebDAV.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/WebDAV.hs')
-rw-r--r--Remote/WebDAV.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs
index 752e0d7ff..21a1456bf 100644
--- a/Remote/WebDAV.hs
+++ b/Remote/WebDAV.hs
@@ -30,6 +30,7 @@ import Remote.Helper.Chunked
import Crypto
import Creds
import Meters
+import Annex.Content
type DavUrl = String
type DavUser = B8.ByteString
@@ -82,16 +83,14 @@ webdavSetup u c = do
store :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
store r k _f p = metered (Just p) k $ \meterupdate ->
- davAction r False $ \(baseurl, user, pass) -> do
- f <- inRepo $ gitAnnexLocation k
- liftIO $ withMeteredFile f meterupdate $
+ davAction r False $ \(baseurl, user, pass) -> sendAnnex k $ \src ->
+ liftIO $ withMeteredFile src meterupdate $
storeHelper r k baseurl user pass
storeEncrypted :: Remote -> (Cipher, Key) -> Key -> MeterUpdate -> Annex Bool
storeEncrypted r (cipher, enck) k p = metered (Just p) k $ \meterupdate ->
- davAction r False $ \(baseurl, user, pass) -> do
- f <- inRepo $ gitAnnexLocation k
- liftIO $ encrypt cipher (streamMeteredFile f meterupdate) $
+ davAction r False $ \(baseurl, user, pass) -> sendAnnex k $ \src ->
+ liftIO $ encrypt cipher (streamMeteredFile src meterupdate) $
readBytes $ storeHelper r enck baseurl user pass
storeHelper :: Remote -> Key -> DavUrl -> DavUser -> DavPass -> L.ByteString -> IO Bool