summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-19 13:30:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-19 13:30:58 -0400
commitaf4886c315f908eb3c59982360fafcc9cdd3ae29 (patch)
tree41607ede808676a57115d37c99273a29c28ffe0c /Remote
parent798c3d45c11cfe3d7604b27f3271f50d0f810db7 (diff)
Bugfix: directory special remote could loop forever storing a key when a too small chunksize was configured.
Ensure that each file has something written to it, even if the bytestring chunk size is greater than the configured chunksize. This means we may write a bit larger than the configured value, but only when the configured value is very small; ie, < 8 kb.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Directory.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index f166c2a0d..737ae6312 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -158,7 +158,7 @@ storeSplit' meterupdate chunksize (d:dests) bs c = do
feed _ [] _ = return []
feed sz (l:ls) h = do
let s = fromIntegral $ S.length l
- if s <= sz
+ if s <= sz || sz == chunksize
then do
S.hPut h l
meterupdate $ toInteger s