mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
Improve channel_rcv_change_window().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@677 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -303,29 +303,36 @@ static CHANNEL *channel_from_msg(SSH_SESSION *session) {
|
|||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void channel_rcv_change_window(SSH_SESSION *session){
|
static void channel_rcv_change_window(SSH_SESSION *session) {
|
||||||
u32 bytes;
|
|
||||||
CHANNEL *channel;
|
CHANNEL *channel;
|
||||||
int err;
|
u32 bytes;
|
||||||
|
int rc;
|
||||||
|
|
||||||
enter_function();
|
enter_function();
|
||||||
channel=channel_from_msg(session);
|
|
||||||
if(!channel)
|
channel = channel_from_msg(session);
|
||||||
ssh_log(session, SSH_LOG_FUNCTIONS, "%s", ssh_get_error(session));
|
if (channel == NULL) {
|
||||||
err = buffer_get_u32(session->in_buffer,&bytes);
|
ssh_log(session, SSH_LOG_FUNCTIONS, ssh_get_error(session));
|
||||||
if(!channel || err!= sizeof(u32)){
|
}
|
||||||
|
|
||||||
|
rc = buffer_get_u32(session->in_buffer, &bytes);
|
||||||
|
if (channel == NULL || rc != sizeof(u32)) {
|
||||||
ssh_log(session, SSH_LOG_PACKET,
|
ssh_log(session, SSH_LOG_PACKET,
|
||||||
"Error getting a window adjust message : invalid packet");
|
"Error getting a window adjust message: invalid packet");
|
||||||
leave_function();
|
leave_function();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bytes=ntohl(bytes);
|
|
||||||
|
bytes = ntohl(bytes);
|
||||||
ssh_log(session, SSH_LOG_PROTOCOL,
|
ssh_log(session, SSH_LOG_PROTOCOL,
|
||||||
"Adding %d bytes to channel (%d:%d) (from %d bytes)",
|
"Adding %d bytes to channel (%d:%d) (from %d bytes)",
|
||||||
bytes,
|
bytes,
|
||||||
channel->local_channel,
|
channel->local_channel,
|
||||||
channel->remote_channel,
|
channel->remote_channel,
|
||||||
channel->remote_window);
|
channel->remote_window);
|
||||||
channel->remote_window+=bytes;
|
|
||||||
|
channel->remote_window += bytes;
|
||||||
|
|
||||||
leave_function();
|
leave_function();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user