1
1

channel_rcv_close: indentation

Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Этот коммит содержится в:
Tom Deseyn 2021-01-08 13:23:00 +01:00 коммит произвёл Anderson Toshiyuki Sasaki
родитель 44dfee778f
Коммит a4b8045fb8

Просмотреть файл

@ -666,37 +666,37 @@ static bool ssh_channel_has_unread_data(ssh_channel channel)
} }
SSH_PACKET_CALLBACK(channel_rcv_close) { SSH_PACKET_CALLBACK(channel_rcv_close) {
ssh_channel channel; ssh_channel channel;
(void)user; (void)user;
(void)type; (void)type;
channel = channel_from_msg(session,packet); channel = channel_from_msg(session,packet);
if (channel == NULL) { if (channel == NULL) {
SSH_LOG(SSH_LOG_FUNCTIONS, "%s", ssh_get_error(session)); SSH_LOG(SSH_LOG_FUNCTIONS, "%s", ssh_get_error(session));
return SSH_PACKET_USED; return SSH_PACKET_USED;
} }
SSH_LOG(SSH_LOG_PACKET, SSH_LOG(SSH_LOG_PACKET,
"Received close on channel (%d:%d)", "Received close on channel (%d:%d)",
channel->local_channel, channel->local_channel,
channel->remote_channel); channel->remote_channel);
if (!ssh_channel_has_unread_data(channel)) { if (!ssh_channel_has_unread_data(channel)) {
channel->state = SSH_CHANNEL_STATE_CLOSED; channel->state = SSH_CHANNEL_STATE_CLOSED;
} else { } else {
channel->delayed_close = 1; channel->delayed_close = 1;
} }
if (channel->remote_eof == 0) { if (channel->remote_eof == 0) {
SSH_LOG(SSH_LOG_PACKET, SSH_LOG(SSH_LOG_PACKET,
"Remote host not polite enough to send an eof before close"); "Remote host not polite enough to send an eof before close");
} }
channel->remote_eof = 1; /*
/* * The remote eof doesn't break things if there was still data into read
* The remote eof doesn't break things if there was still data into read * buffer because the eof is ignored until the buffer is empty.
* buffer because the eof is ignored until the buffer is empty. */
*/ channel->remote_eof = 1;
ssh_callbacks_execute_list(channel->callbacks, ssh_callbacks_execute_list(channel->callbacks,
ssh_channel_callbacks, ssh_channel_callbacks,
@ -704,11 +704,11 @@ SSH_PACKET_CALLBACK(channel_rcv_close) {
channel->session, channel->session,
channel); channel);
channel->flags |= SSH_CHANNEL_FLAG_CLOSED_REMOTE; channel->flags |= SSH_CHANNEL_FLAG_CLOSED_REMOTE;
if(channel->flags & SSH_CHANNEL_FLAG_FREED_LOCAL) if(channel->flags & SSH_CHANNEL_FLAG_FREED_LOCAL)
ssh_channel_do_free(channel); ssh_channel_do_free(channel);
return SSH_PACKET_USED; return SSH_PACKET_USED;
} }
SSH_PACKET_CALLBACK(channel_rcv_request) { SSH_PACKET_CALLBACK(channel_rcv_request) {