Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
9bc897f3
Commit
9bc897f3
authored
15 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Andre Guibert de Bruet improved the libssh2 error code translation
parent
9b0e57b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ssh.c
+30
-2
30 additions, 2 deletions
lib/ssh.c
with
30 additions
and
2 deletions
lib/ssh.c
+
30
−
2
View file @
9bc897f3
...
...
@@ -264,8 +264,36 @@ static CURLcode sftp_libssh2_error_to_CURLE(int err)
static
CURLcode
libssh2_session_error_to_CURLE
(
int
err
)
{
if
(
err
==
LIBSSH2_ERROR_ALLOC
)
return
CURLE_OUT_OF_MEMORY
;
switch
(
err
)
{
/* Ordered by order of appearance in libssh2.h */
case
LIBSSH2_ERROR_NONE
:
return
CURLE_OK
;
case
LIBSSH2_ERROR_SOCKET_NONE
:
return
CURLE_COULDNT_CONNECT
;
case
LIBSSH2_ERROR_ALLOC
:
return
CURLE_OUT_OF_MEMORY
;
case
LIBSSH2_ERROR_SOCKET_SEND
:
return
CURLE_SEND_ERROR
;
case
LIBSSH2_ERROR_HOSTKEY_INIT
:
case
LIBSSH2_ERROR_HOSTKEY_SIGN
:
case
LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
:
case
LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED
:
return
CURLE_PEER_FAILED_VERIFICATION
;
case
LIBSSH2_ERROR_PASSWORD_EXPIRED
:
return
CURLE_LOGIN_DENIED
;
case
LIBSSH2_ERROR_SOCKET_TIMEOUT
:
case
LIBSSH2_ERROR_TIMEOUT
:
return
CURLE_OPERATION_TIMEDOUT
;
case
LIBSSH2_ERROR_EAGAIN
:
return
CURLE_AGAIN
;
}
/* TODO: map some more of the libssh2 errors to the more appropriate CURLcode
error code, and possibly add a few new SSH-related one. We must however
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment