diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-10-26 15:38:22 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-10-26 15:38:27 -0400 |
commit | c6122cf0a40ce4c565957f68e1076b6ada5c2bea (patch) | |
tree | b2b2a4e52a48d79e3984b5e39672d738d2dbfa8d /Command | |
parent | 85cb9ac4ab6844166e539ddc6b15922f79c74a19 (diff) |
enable forwardRetry for command-line transfers
If a transfer fails for some reason, but some data managed to be sent, the
transfer will be retried. (The assistant already did this.)
Possible impacts:
* More ssh prompts if ssh needs to prompt for a password to connect to a
host, or is prompting about some other problem like a ssh key mismatch.
* More data transfer due to retrying, epecially when a remote does not
support resuming a transfer.
In the worst case, a lot of data will be transferred but it fails before
the end, and then all that data gets transferred again plus one byte more;
repeat until it manages to get the whole file.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Get.hs | 2 | ||||
-rw-r--r-- | Command/Move.hs | 4 | ||||
-rw-r--r-- | Command/SendKey.hs | 1 |
3 files changed, 4 insertions, 3 deletions
diff --git a/Command/Get.hs b/Command/Get.hs index a0c7aff47..abf95e48a 100644 --- a/Command/Get.hs +++ b/Command/Get.hs @@ -109,7 +109,7 @@ getKey' key afile = dispatch either (const False) id <$> Remote.hasKey r key | otherwise = return True docopy r witness = getViaTmp (RemoteVerify r) key $ \dest -> - download (Remote.uuid r) key afile noRetry + download (Remote.uuid r) key afile forwardRetry (\p -> do showAction $ "from " ++ Remote.name r Remote.retrieveKeyFile r key afile dest p diff --git a/Command/Move.hs b/Command/Move.hs index b44041f6c..9c43c6f1d 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -114,7 +114,7 @@ toPerform dest move key afile fastcheck isthere = Right False -> do showAction $ "to " ++ Remote.name dest ok <- notifyTransfer Upload afile $ - upload (Remote.uuid dest) key afile noRetry $ + upload (Remote.uuid dest) key afile forwardRetry $ Remote.storeKey dest key afile if ok then finish $ @@ -177,7 +177,7 @@ fromPerform src move key afile = ifM (inAnnex key) ) where go = notifyTransfer Download afile $ - download (Remote.uuid src) key afile noRetry $ \p -> do + download (Remote.uuid src) key afile forwardRetry $ \p -> do showAction $ "from " ++ Remote.name src getViaTmp (RemoteVerify src) key $ \t -> Remote.retrieveKeyFile src key afile t p diff --git a/Command/SendKey.hs b/Command/SendKey.hs index 68da10316..302810374 100644 --- a/Command/SendKey.hs +++ b/Command/SendKey.hs @@ -48,6 +48,7 @@ fieldTransfer direction key a = do liftIO $ debugM "fieldTransfer" "transfer start" afile <- Fields.getField Fields.associatedFile ok <- maybe (a $ const noop) + -- Using noRetry here because we're the sender. (\u -> runner (Transfer direction (toUUID u) key) afile noRetry a) =<< Fields.getField Fields.remoteUUID liftIO $ debugM "fieldTransfer" "transfer done" |