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.
This commit is contained in:
Joey Hess 2016-10-26 15:38:22 -04:00
parent ca2435b21b
commit 8dcf79694d
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
7 changed files with 75 additions and 5 deletions

View file

@ -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