summaryrefslogtreecommitdiff
path: root/Remote/Helper
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Helper')
-rw-r--r--Remote/Helper/Chunked.hs10
-rw-r--r--Remote/Helper/Chunked/Legacy.hs4
2 files changed, 7 insertions, 7 deletions
diff --git a/Remote/Helper/Chunked.hs b/Remote/Helper/Chunked.hs
index aafa6b700..a71c39fbc 100644
--- a/Remote/Helper/Chunked.hs
+++ b/Remote/Helper/Chunked.hs
@@ -13,18 +13,20 @@ import Types.Remote
import qualified Data.Map as M
import Data.Int
+type ChunkSize = Int64
+
data ChunkConfig
= NoChunks
- | ChunkSize Int64
- | LegacyChunkSize Int64
+ | UnpaddedChunks ChunkSize
+ | LegacyChunks ChunkSize
chunkConfig :: RemoteConfig -> ChunkConfig
chunkConfig m =
case M.lookup "chunksize" m of
Nothing -> case M.lookup "chunk" m of
Nothing -> NoChunks
- Just v -> ChunkSize $ readsz v "chunk"
- Just v -> LegacyChunkSize $ readsz v "chunksize"
+ Just v -> UnpaddedChunks $ readsz v "chunk"
+ Just v -> LegacyChunks $ readsz v "chunksize"
where
readsz v f = case readSize dataUnits v of
Just size | size > 0 -> fromInteger size
diff --git a/Remote/Helper/Chunked/Legacy.hs b/Remote/Helper/Chunked/Legacy.hs
index b35bc92a0..3b6b0d47f 100644
--- a/Remote/Helper/Chunked/Legacy.hs
+++ b/Remote/Helper/Chunked/Legacy.hs
@@ -9,13 +9,11 @@ module Remote.Helper.Chunked.Legacy where
import Common.Annex
import Utility.Metered
+import Remote.Helper.Chunked (ChunkSize)
import qualified Data.ByteString.Lazy as L
-import Data.Int
import qualified Control.Exception as E
-type ChunkSize = Int64
-
{- This is an extension that's added to the usual file (or whatever)
- where the remote stores a key. -}
type ChunkExt = String