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>
This commit is contained in:
Nikos Mavrogiannopoulos 2017-10-26 11:08:43 +02:00 коммит произвёл Daniel Stenberg
Родитель c92d2e14cf
Коммит 75427291e5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -261,6 +261,11 @@ static CURLcode libssh2_session_error_to_CURLE(int err)
case LIBSSH2_ERROR_NONE: case LIBSSH2_ERROR_NONE:
return CURLE_OK; 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: case LIBSSH2_ERROR_SOCKET_NONE:
return CURLE_COULDNT_CONNECT; return CURLE_COULDNT_CONNECT;

Просмотреть файл

@ -24,7 +24,7 @@ SCP retrieval of nonexistent file
# Verify data after the test has been "shot" # Verify data after the test has been "shot"
<verify> <verify>
<errorcode> <errorcode>
79 78
</errorcode> </errorcode>
<valgrind> <valgrind>
disable disable