summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-06 16:44:13 -0600
committerGravatar Joey Hess <joey@kitenet.net>2012-07-06 16:44:13 -0600
commit62876502c55958cd8f716d6676eb97825456d9b7 (patch)
tree91bd4a801bb53cee557be73b175bfcc6220cc0e4 /Logs
parent4a107951442f30354fa90b0b31200a9fdc86ffca (diff)
wait on child transfer processes, and invalidate cache
There's still a bug; if the child updates its transfer info file, then the data from it will superscede the TransferInfo, losing the info that we should wait on this child.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Transfer.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs
index 54f98da5c..494a44c51 100644
--- a/Logs/Transfer.hs
+++ b/Logs/Transfer.hs
@@ -38,6 +38,7 @@ data TransferInfo = TransferInfo
, transferRemote :: Maybe Remote
, bytesComplete :: Maybe Integer
, associatedFile :: Maybe FilePath
+ , shouldWait :: Bool
}
deriving (Show, Eq, Ord)
@@ -80,6 +81,7 @@ transfer t file a = do
<*> pure Nothing -- not 0; transfer may be resuming
<*> pure Nothing
<*> pure file
+ <*> pure False
bracketIO (prep tfile mode info) (cleanup tfile) a
where
prep tfile mode info = do
@@ -169,6 +171,7 @@ readTransferInfo pid s =
<*> pure Nothing
<*> pure Nothing
<*> pure (if null filename then Nothing else Just filename)
+ <*> pure False
_ -> Nothing
where
(bits, filebits) = splitAt 1 $ lines s