1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

channels: Reformat channel_rcv_change_window

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
Jakub Jelen
2023-06-20 14:26:59 +02:00
parent e6d2b6c713
commit a45b9938fe

View File

@@ -556,24 +556,27 @@ SSH_PACKET_CALLBACK(channel_rcv_change_window) {
} }
/* is_stderr is set to 1 if the data are extended, ie stderr */ /* is_stderr is set to 1 if the data are extended, ie stderr */
SSH_PACKET_CALLBACK(channel_rcv_data){ SSH_PACKET_CALLBACK(channel_rcv_data)
ssh_channel channel; {
ssh_string str; ssh_channel channel = NULL;
ssh_buffer buf; ssh_string str = NULL;
ssh_buffer buf = NULL;
void *data = NULL;
uint32_t len; uint32_t len;
int is_stderr; int is_stderr;
int rest; int rest;
(void)user; (void)user;
if(type==SSH2_MSG_CHANNEL_DATA) if (type == SSH2_MSG_CHANNEL_DATA) {
is_stderr = 0; is_stderr = 0;
else } else {
is_stderr = 1; is_stderr = 1;
}
channel = channel_from_msg(session, packet); channel = channel_from_msg(session, packet);
if (channel == NULL) { if (channel == NULL) {
SSH_LOG(SSH_LOG_FUNCTIONS, SSH_LOG(SSH_LOG_FUNCTIONS, "%s", ssh_get_error(session));
"%s", ssh_get_error(session));
return SSH_PACKET_USED; return SSH_PACKET_USED;
} }
@@ -593,7 +596,8 @@ SSH_PACKET_CALLBACK(channel_rcv_data){
len = ssh_string_len(str); len = ssh_string_len(str);
SSH_LOG(SSH_LOG_PACKET, SSH_LOG(SSH_LOG_PACKET,
"Channel receiving %" PRIu32 " bytes data in %d (local win=%" PRIu32 " remote win=%" PRIu32 ")", "Channel receiving %" PRIu32 " bytes data in %d (local win=%" PRIu32
" remote win=%" PRIu32 ")",
len, len,
is_stderr, is_stderr,
channel->local_window, channel->local_window,
@@ -607,8 +611,8 @@ SSH_PACKET_CALLBACK(channel_rcv_data){
channel->local_window); channel->local_window);
} }
if (channel_default_bufferize(channel, ssh_string_data(str), len, data = ssh_string_data(str);
is_stderr) < 0) { if (channel_default_bufferize(channel, data, len, is_stderr) < 0) {
SSH_STRING_FREE(str); SSH_STRING_FREE(str);
return SSH_PACKET_USED; return SSH_PACKET_USED;