From 75427291e5e06afed7aff0de992cad2cbec5a214 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 26 Oct 2017 11:08:43 +0200 Subject: 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 --- lib/ssh.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/ssh.c') diff --git a/lib/ssh.c b/lib/ssh.c index 54f08edf7..e0e88632d 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -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; -- cgit v1.2.3