From: Nikos Mavrogiannopoulos Date: Sun, 5 Nov 2017 14:06:30 +0000 (+0100) Subject: libssh2: return CURLE_UPLOAD_FAILED on failure to upload X-Git-Tag: curl-7_58_0~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38aef6dc454d7edc335c44edfec72c7eb151b029;p=curl 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 --- diff --git a/lib/ssh.c b/lib/ssh.c index e0e88632d..ef169ade7 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -2368,6 +2368,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) failf(conn->data, "%s", err_msg); state(conn, SSH_SCP_CHANNEL_FREE); 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; } diff --git a/tests/data/test623 b/tests/data/test623 index 1a639d69f..f4b32dcaf 100644 --- a/tests/data/test623 +++ b/tests/data/test623 @@ -37,7 +37,7 @@ for ssh upload test disable -79 +25