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:
@@ -556,24 +556,27 @@ SSH_PACKET_CALLBACK(channel_rcv_change_window) {
|
||||
}
|
||||
|
||||
/* is_stderr is set to 1 if the data are extended, ie stderr */
|
||||
SSH_PACKET_CALLBACK(channel_rcv_data){
|
||||
ssh_channel channel;
|
||||
ssh_string str;
|
||||
ssh_buffer buf;
|
||||
SSH_PACKET_CALLBACK(channel_rcv_data)
|
||||
{
|
||||
ssh_channel channel = NULL;
|
||||
ssh_string str = NULL;
|
||||
ssh_buffer buf = NULL;
|
||||
void *data = NULL;
|
||||
uint32_t len;
|
||||
int is_stderr;
|
||||
int rest;
|
||||
|
||||
(void)user;
|
||||
|
||||
if(type==SSH2_MSG_CHANNEL_DATA)
|
||||
is_stderr=0;
|
||||
else
|
||||
is_stderr=1;
|
||||
if (type == SSH2_MSG_CHANNEL_DATA) {
|
||||
is_stderr = 0;
|
||||
} else {
|
||||
is_stderr = 1;
|
||||
}
|
||||
|
||||
channel = channel_from_msg(session,packet);
|
||||
channel = channel_from_msg(session, packet);
|
||||
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;
|
||||
}
|
||||
@@ -593,7 +596,8 @@ SSH_PACKET_CALLBACK(channel_rcv_data){
|
||||
len = ssh_string_len(str);
|
||||
|
||||
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,
|
||||
is_stderr,
|
||||
channel->local_window,
|
||||
@@ -607,8 +611,8 @@ SSH_PACKET_CALLBACK(channel_rcv_data){
|
||||
channel->local_window);
|
||||
}
|
||||
|
||||
if (channel_default_bufferize(channel, ssh_string_data(str), len,
|
||||
is_stderr) < 0) {
|
||||
data = ssh_string_data(str);
|
||||
if (channel_default_bufferize(channel, data, len, is_stderr) < 0) {
|
||||
SSH_STRING_FREE(str);
|
||||
|
||||
return SSH_PACKET_USED;
|
||||
|
||||
Reference in New Issue
Block a user