aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssh.c')
-rw-r--r--lib/ssh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index de3382698..6b21c5a8c 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1142,7 +1142,13 @@ CURLcode Curl_scp_do(struct connectdata *conn, bool *done)
if (!scp->ssh_channel &&
(libssh2_session_last_errno(scp->ssh_session) !=
LIBSSH2_ERROR_EAGAIN)) {
- return CURLE_FAILED_INIT;
+ int err;
+ char *err_msg;
+
+ err = libssh2_session_error_to_CURLE(
+ libssh2_session_last_error(scp->ssh_session, &err_msg, NULL, 0));
+ failf(conn->data, "%s", err_msg);
+ return err;
}
} while (!scp->ssh_channel);
#else /* !(LIBSSH2_APINO >= 200706012030) */