Fixes SFTP upload with --create-dirs when running via multi handle #1269

wants to merge 2 commits into


None yet

3 participants

jgressmann commented Feb 19, 2017 edited

So this is odd.

curl -k sftp://foo:bar@localhost/~/1/2/3/4/5/6/7/8  --ftp-create-dirs -T file  -vvvv

will work fine and create the necessary dirs.

If I do the equivalent but run it with a multi handle the socket will be retired due to the rc not being reset in line 1803.
Similarly, the rc needs to be reset to 0 if some part of the directory hierarchy exists (lines 1955-1957).
Finally, line 1939 takes all error codes into account.


@jgressmann jgressmann Fixes SFTP upload with --create-dirs when running via multi handle

@jgressmann, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bagder, @yangtse and @greearb to be potential reviewers.

@jgressmann jgressmann ssh: more clearing of rc in case things fail
Multiple parallel SFTP uploads via a multi handle will fail unless these
rc's are cleared.
@bagder bagder added the SCP/SFTP label Feb 20, 2017
@bagder bagder added a commit that closed this pull request Feb 20, 2017
@jgressmann @bagder jgressmann + bagder sftp: improved checks for create dir failures
Since negative values are errors and not only -1. This makes SFTP upload
with --create-dirs work (again).

Closes #1269
@bagder bagder closed this in af30f11 Feb 20, 2017
bagder commented Feb 20, 2017

Thanks, I squashed them and merged just now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment