From: Yang Tse Date: Tue, 22 Jan 2008 17:26:42 +0000 (+0000) Subject: when unable to initialize sftp session, also log failure reason X-Git-Tag: curl-7_18_0~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acd7c94598cd33495fa167627f0539834f39154b;p=curl when unable to initialize sftp session, also log failure reason --- diff --git a/lib/ssh.c b/lib/ssh.c index 7bebefc74..c3cd435fd 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -733,7 +733,11 @@ static CURLcode ssh_statemach_act(struct connectdata *conn) break; } else { - failf(data, "Failure initialising sftp session"); + char *err_msg; + + (void)libssh2_session_last_error(sshc->ssh_session, + &err_msg, NULL, 0); + failf(data, "Failure initializing sftp session: %s", err_msg); state(conn, SSH_SESSION_FREE); sshc->actualcode = CURLE_FAILED_INIT; break;