aboutsummaryrefslogtreecommitdiff
path: root/P2P
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-12-07 15:06:07 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-12-07 15:06:07 -0400
commit7a3e845add8c654dbb87fe427afd8655e6681792 (patch)
treeb6ed80ef776d9b6e7a7350a36911c6d01cee884b /P2P
parentdc08aeb67718d8fbe339ab51f0d7a1bf85fd597e (diff)
open file for append, not write, so resuming works
WriteMode zeros any existing content, so the seek filled with zeros, and verification failed after download.
Diffstat (limited to 'P2P')
-rw-r--r--P2P/Annex.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/P2P/Annex.hs b/P2P/Annex.hs
index 4105abe32..daab74447 100644
--- a/P2P/Annex.hs
+++ b/P2P/Annex.hs
@@ -120,7 +120,7 @@ runLocal runmode runner a = case a of
-- a client.
Client -> ta
storefile dest (Offset o) (Len l) b = liftIO $ do
- withBinaryFile dest WriteMode $ \h -> do
+ withBinaryFile dest AppendMode $ \h -> do
when (o /= 0) $
hSeek h AbsoluteSeek o
L.hPut h b