diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-10-26 11:08:43 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-12-01 17:35:15 +0100 |
commit | 75427291e5e06afed7aff0de992cad2cbec5a214 (patch) | |
tree | 9ad7d689224c9320ad3a2ee178e57844d2e3191c /lib/ssh.c | |
parent | c92d2e14cfb0db662f958effd2ac86f995cf1b5a (diff) | |
download | curl-75427291e5e06afed7aff0de992cad2cbec5a214.tar.gz |
libssh2: send the correct CURLE error code on scp file not found
That also updates tests to expect the right error code
libssh2 back-end returns CURLE_SSH error if the remote file
is not found. Expect instead CURLE_REMOTE_FILE_NOT_FOUND
which is sent by the libssh backend.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/ssh.c')
-rw-r--r-- | lib/ssh.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -261,6 +261,11 @@ static CURLcode libssh2_session_error_to_CURLE(int err) case LIBSSH2_ERROR_NONE: return CURLE_OK; + /* This is the error returned by libssh2_scp_recv2 + * on unknown file */ + case LIBSSH2_ERROR_SCP_PROTOCOL: + return CURLE_REMOTE_FILE_NOT_FOUND; + case LIBSSH2_ERROR_SOCKET_NONE: return CURLE_COULDNT_CONNECT; |