diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2007-03-29 19:17:18 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2007-03-29 19:17:18 +0000 |
commit | 7763bb917236cb3a38ae4dee2ca14228fb8afa14 (patch) | |
tree | 72d7aea82cfceccc34ce5224217238f2367d2cf2 | |
parent | e37a49086ecea40f6dc839043caca6d2bf65355b (diff) |
Send an EOF message before closing a channel, as recommended by RFC4254.
Enable libssh2 tracing when ssh debugging is turned on.
-rw-r--r-- | lib/ssh.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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"); } |