aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Housley <jim@thehousleys.net>2007-08-03 13:57:37 +0000
committerJames Housley <jim@thehousleys.net>2007-08-03 13:57:37 +0000
commite7a50e37d68f399b3b27edf04a34aa8690eda403 (patch)
treed192145e94039f43e580628e105e8a2e8e5e09ba /lib
parent9fa05db83b104509bdbce7baa3fd46fba4b5e850 (diff)
Start adding some expanded error conversion of libssh2 errors.
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index 332ae9da2..ec1914a33 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -174,14 +174,15 @@ static CURLcode sftp_libssh2_error_to_CURLE(unsigned long err)
not return or even depend on libssh2 errors in the public libcurl API */
if (err == LIBSSH2_FX_NO_SUCH_FILE)
- return CURLE_REMOTE_FILE_NOT_FOUND;
+ return CURLE_REMOTE_FILE_NOT_FOUND;
return CURLE_SSH;
}
static CURLcode libssh2_session_error_to_CURLE(int err)
{
- (void)err;
+ if (err == LIBSSH2_ERROR_ALLOC)
+ return CURLE_OUT_OF_MEMORY;
return CURLE_SSH;
}
@@ -350,12 +351,12 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
strlen(sftp_scp->user));
if (!sshc->authlist) {
- if (libssh2_session_last_errno(sftp_scp->ssh_session) ==
+ if ((err = libssh2_session_last_errno(sftp_scp->ssh_session)) ==
LIBSSH2_ERROR_EAGAIN) {
break;
} else {
state(conn, SSH_SESSION_FREE);
- sshc->actualCode = CURLE_OUT_OF_MEMORY;
+ sshc->actualCode = libssh2_session_error_to_CURLE(err);
break;
}
}