Send an EOF message before closing a channel, as recommended by RFC4254.

Enable libssh2 tracing when ssh debugging is turned on.
This commit is contained in:
Dan Fandrich 2007-03-29 19:17:18 +00:00
parent e37a49086e
commit 7763bb9172
1 changed files with 4 additions and 0 deletions

View File

@ -306,6 +306,7 @@ CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done)
return CURLE_FAILED_INIT;
}
#ifdef CURL_LIBSSH2_DEBUG
libssh2_trace(ssh->ssh_session, LIBSSH2_TRACE_CONN|LIBSSH2_TRACE_TRANS|LIBSSH2_TRACE_SCP|LIBSSH2_TRACE_SFTP|LIBSSH2_TRACE_ERROR);
infof(data, "SSH socket: %d\n", sock);
#endif /* CURL_LIBSSH2_DEBUG */
@ -608,6 +609,9 @@ CURLcode Curl_scp_done(struct connectdata *conn, CURLcode status,
scp->path = NULL;
if (scp->ssh_channel) {
if (conn->data->set.upload && libssh2_channel_send_eof(scp->ssh_channel) < 0) {
infof(conn->data, "Failed to send libssh2 channel EOF\n");
}
if (libssh2_channel_close(scp->ssh_channel) < 0) {
infof(conn->data, "Failed to stop libssh2 channel subsystem\n");
}