aboutsummaryrefslogtreecommitdiff
path: root/Remote/WebDAV
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-08-08 13:40:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-08-08 13:40:55 -0400
commit3f1ab65c082f62961e9b2bae96e9b0f88f3707f7 (patch)
tree9b1d1a29b73bedda2adb5023537720178e5436ca /Remote/WebDAV
parenta122351089de94f10441ba8e6c8a24fcf6107f85 (diff)
WebDAV: Avoid buffering whole file in memory when downloading.
httpBodyRetriever will later also be used by S3 This commit was sponsored by Ethan Aubin.
Diffstat (limited to 'Remote/WebDAV')
-rw-r--r--Remote/WebDAV/DavLocation.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Remote/WebDAV/DavLocation.hs b/Remote/WebDAV/DavLocation.hs
index 3b52f3a64..33c3aa079 100644
--- a/Remote/WebDAV/DavLocation.hs
+++ b/Remote/WebDAV/DavLocation.hs
@@ -29,8 +29,8 @@ inLocation :: (MonadIO m) => DavLocation -> DAVT m a -> DAVT m a
inLocation d = inDAVLocation (</> d)
{- The directory where files(s) for a key are stored. -}
-keyLocation :: Key -> DavLocation
-keyLocation k = addTrailingPathSeparator $ hashdir </> keyFile k
+keyDir :: Key -> DavLocation
+keyDir k = addTrailingPathSeparator $ hashdir </> keyFile k
where
#ifndef mingw32_HOST_OS
hashdir = hashDirLower k
@@ -38,6 +38,9 @@ keyLocation k = addTrailingPathSeparator $ hashdir </> keyFile k
hashdir = replace "\\" "/" (hashDirLower k)
#endif
+keyLocation :: Key -> DavLocation
+keyLocation k = keyDir k ++ keyFile k
+
{- Where we store temporary data for a key as it's being uploaded. -}
keyTmpLocation :: Key -> DavLocation
keyTmpLocation = addTrailingPathSeparator . tmpLocation . keyFile