Commit 0a4932a4 authored by Niels Möller's avatar Niels Möller
Browse files

(window_adjust_handler): Deleted redundant assert.

(do_channels_after_keyexchange): Renamed to do_channels_wakeup. No
longer needs to reinstall the handler.
(init_connection_service): Use connection_wakeup, not
connection_after_keyexchange.

Rev: src/channel.c:1.124
Rev: src/channel.h:1.77
parent f7b62d70
...@@ -1171,13 +1171,11 @@ DEFINE_PACKET_HANDLER(static, window_adjust_handler, ...@@ -1171,13 +1171,11 @@ DEFINE_PACKET_HANDLER(static, window_adjust_handler,
if (! (channel->flags & (CHANNEL_SENT_CLOSE | CHANNEL_SENT_EOF))) if (! (channel->flags & (CHANNEL_SENT_CLOSE | CHANNEL_SENT_EOF)))
{ {
channel->send_window_size += size; channel->send_window_size += size;
if (channel->send_window_size && channel->send_adjust) if (channel->send_window_size && channel->send_adjust)
{
assert(channel->send_window_size);
CHANNEL_SEND_ADJUST(channel, size); CHANNEL_SEND_ADJUST(channel, size);
} }
} }
}
else else
{ {
werror("SSH_MSG_CHANNEL_WINDOW_ADJUST on nonexistant or closed " werror("SSH_MSG_CHANNEL_WINDOW_ADJUST on nonexistant or closed "
...@@ -1628,16 +1626,11 @@ DEFINE_PACKET_HANDLER(static, channel_failure_handler, ...@@ -1628,16 +1626,11 @@ DEFINE_PACKET_HANDLER(static, channel_failure_handler,
PROTOCOL_ERROR(connection->e, "Invalid CHANNEL_FAILURE message."); PROTOCOL_ERROR(connection->e, "Invalid CHANNEL_FAILURE message.");
} }
/* During keyexchange, and when the connection's write buffer gets
full, we do not allow more channel data. This function is called
when data is reallowed. */
static void static void
do_channels_after_keyexchange(struct command_continuation *s UNUSED, do_channels_wakeup(struct command_continuation *s UNUSED,
struct lsh_object *x);
static struct command_continuation
channels_after_keyexchange =
{ STATIC_HEADER, do_channels_after_keyexchange };
static void
do_channels_after_keyexchange(struct command_continuation *s UNUSED,
struct lsh_object *x) struct lsh_object *x)
{ {
CAST(ssh_connection, connection, x); CAST(ssh_connection, connection, x);
...@@ -1655,11 +1648,12 @@ do_channels_after_keyexchange(struct command_continuation *s UNUSED, ...@@ -1655,11 +1648,12 @@ do_channels_after_keyexchange(struct command_continuation *s UNUSED,
&& channel->send_adjust) && channel->send_adjust)
CHANNEL_SEND_ADJUST(channel, 0); CHANNEL_SEND_ADJUST(channel, 0);
} }
/* Reinstall hook */
connection_after_keyexchange(connection, &channels_after_keyexchange);
} }
static struct command_continuation
channels_wakeup =
{ STATIC_HEADER, do_channels_wakeup };
void void
init_connection_service(struct ssh_connection *connection) init_connection_service(struct ssh_connection *connection)
{ {
...@@ -1673,7 +1667,7 @@ init_connection_service(struct ssh_connection *connection) ...@@ -1673,7 +1667,7 @@ init_connection_service(struct ssh_connection *connection)
connection_clear_timeout(connection); connection_clear_timeout(connection);
/* Unfreeze channels after key exchange */ /* Unfreeze channels after key exchange */
connection_after_keyexchange(connection, &channels_after_keyexchange); connection_wakeup(connection, &channels_wakeup);
connection->dispatch[SSH_MSG_GLOBAL_REQUEST] connection->dispatch[SSH_MSG_GLOBAL_REQUEST]
= &global_request_handler; = &global_request_handler;
......
...@@ -108,7 +108,7 @@ struct channel_request_info ...@@ -108,7 +108,7 @@ struct channel_request_info
; put onto the connections resource list. ; put onto the connections resource list.
(resources object resource_list) (resources object resource_list)
; NOTE: The channels maximum packet sizes refer to the packet ; NOTE: The channel's maximum packet sizes refer to the packet
; payload, i.e. the DATA string in SSH_CHANNEL_DATA and ; payload, i.e. the DATA string in SSH_CHANNEL_DATA and
; SSH_MSG_CHANNEL_EXTENDED_DATA. ; SSH_MSG_CHANNEL_EXTENDED_DATA.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment