1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

libssh2: return CURLE_UPLOAD_FAILED on failure to upload

This brings its in sync with the error code returned by the
libssh backend.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
Nikos Mavrogiannopoulos 2017-11-05 15:06:30 +01:00 committed by Daniel Stenberg
parent 75427291e5
commit 38aef6dc45
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 5 additions and 1 deletions

View File

@ -2368,6 +2368,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
failf(conn->data, "%s", err_msg); failf(conn->data, "%s", err_msg);
state(conn, SSH_SCP_CHANNEL_FREE); state(conn, SSH_SCP_CHANNEL_FREE);
sshc->actualcode = libssh2_session_error_to_CURLE(ssh_err); sshc->actualcode = libssh2_session_error_to_CURLE(ssh_err);
/* Map generic errors to upload failed */
if(sshc->actualcode == CURLE_SSH ||
sshc->actualcode == CURLE_REMOTE_FILE_NOT_FOUND)
sshc->actualcode = CURLE_UPLOAD_FAILED;
break; break;
} }

View File

@ -37,7 +37,7 @@ for ssh upload test
disable disable
</valgrind> </valgrind>
<errorcode> <errorcode>
79 25
</errorcode> </errorcode>
</verify> </verify>