diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-09-25 15:42:04 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-10-19 22:01:28 +0200 |
commit | da6f7bad01bd09a033f963b331fd35825c9edf3c (patch) | |
tree | 1f320a1046975873d7985a8f5b4047dab036ad68 | |
parent | c5c219f2d36a15bebc23365741ce3f036ba9fb47 (diff) | |
download | libssh-da6f7bad01bd09a033f963b331fd35825c9edf3c.tar.gz libssh-da6f7bad01bd09a033f963b331fd35825c9edf3c.tar.xz libssh-da6f7bad01bd09a033f963b331fd35825c9edf3c.zip |
channels: Reformat ssh_channel_send_eof()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | src/channels.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/channels.c b/src/channels.c index 14da14d9..6a5849e8 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1080,43 +1080,44 @@ void ssh_channel_do_free(ssh_channel channel) * @see ssh_channel_free() * @see ssh_channel_is_eof() */ -int ssh_channel_send_eof(ssh_channel channel){ - ssh_session session; - int rc = SSH_ERROR; - int err; - - if(channel == NULL) { - return rc; - } +int ssh_channel_send_eof(ssh_channel channel) +{ + ssh_session session; + int rc = SSH_ERROR; + int err; - session = channel->session; + if(channel == NULL) { + return rc; + } - err = ssh_buffer_pack(session->out_buffer, - "bd", - SSH2_MSG_CHANNEL_EOF, - channel->remote_channel); - if (err != SSH_OK) { - ssh_set_error_oom(session); - goto error; - } + session = channel->session; - rc = ssh_packet_send(session); - SSH_LOG(SSH_LOG_PACKET, - "Sent a EOF on client channel (%d:%d)", - channel->local_channel, - channel->remote_channel); + err = ssh_buffer_pack(session->out_buffer, + "bd", + SSH2_MSG_CHANNEL_EOF, + channel->remote_channel); + if (err != SSH_OK) { + ssh_set_error_oom(session); + goto error; + } - rc = ssh_channel_flush(channel); - if(rc == SSH_ERROR) - goto error; + rc = ssh_packet_send(session); + SSH_LOG(SSH_LOG_PACKET, + "Sent a EOF on client channel (%d:%d)", + channel->local_channel, + channel->remote_channel); - channel->local_eof = 1; + rc = ssh_channel_flush(channel); + if (rc == SSH_ERROR) { + goto error; + } + channel->local_eof = 1; - return rc; + return rc; error: - ssh_buffer_reinit(session->out_buffer); + ssh_buffer_reinit(session->out_buffer); - return rc; + return rc; } /** |