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.
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.
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.
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).
Thanks, I squashed them and merged just now!