]> granicus.if.org Git - curl/commitdiff
libssh2: return CURLE_UPLOAD_FAILED on failure to upload
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 5 Nov 2017 14:06:30 +0000 (15:06 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 1 Dec 2017 16:35:15 +0000 (17:35 +0100)
This brings its in sync with the error code returned by the
libssh backend.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lib/ssh.c
tests/data/test623

index e0e88632d7ffea3fb85139ae7ab599e2da5b5a88..ef169ade7eb617ac62cc064d441efb80c9881026 100644 (file)
--- 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;
       }
 
index 1a639d69f1bfe0d7a5c1b6f13511fe5ece76f40a..f4b32dcaf129408a9e68da7d2fd24a5385a11d8d 100644 (file)
@@ -37,7 +37,7 @@ for ssh upload test
 disable
 </valgrind>
 <errorcode>
-79
+25
 </errorcode>
 
 </verify>