Commit 943c4479 authored by Niels Möller's avatar Niels Möller
Browse files

(do_channels_after_keyexchange): New function.

(init_connection_service): Call connection_after_keyexchange, to
start reading again after a key exchange.

Rev: src/channel.c:1.108
Rev: src/channel.h:1.71
parent 3d6c2a70
......@@ -1589,8 +1589,40 @@ DEFINE_PACKET_HANDLER(static, channel_failure_handler,
PROTOCOL_ERROR(connection->e, "Invalid CHANNEL_FAILURE message.");
}
static void
do_channels_after_keyexchange(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)
{
CAST(ssh_connection, connection, x);
struct channel_table *table = connection->table;
UINT32 i;
/* Iterate over all channels, and call CHANNEL_SEND_ADJUST to get
* them started again. */
void init_connection_service(struct ssh_connection *connection)
for (i = 0; i<table->used_channels; i++)
{
struct ssh_channel *channel = lookup_channel(table, i);
if (channel
&& !(channel->flags & (CHANNEL_SENT_CLOSE | CHANNEL_SENT_EOF))
&& channel->send_adjust)
CHANNEL_SEND_ADJUST(channel, 0);
}
/* Reinstall hook */
connection_after_keyexchange(connection, &channels_after_keyexchange);
}
void
init_connection_service(struct ssh_connection *connection)
{
struct channel_table *table = make_channel_table();
......@@ -1600,6 +1632,9 @@ void init_connection_service(struct ssh_connection *connection)
/* Cancel handshake timeout */
connection_clear_timeout(connection);
/* Unfreeze channels after key exchange */
connection_after_keyexchange(connection, &channels_after_keyexchange);
connection->dispatch[SSH_MSG_GLOBAL_REQUEST]
= &global_request_handler;
......
......@@ -204,9 +204,9 @@ struct channel_request_info
; method as is traditionally used for allocation of unix file
; descriptors.
; Channel numbers can be reserved before there is any actual channel
; assigned to them. So the channels table is not enough for keeping track of which
; numbers are in use.
; Channel numbers can be reserved before there is any actual
; channel assigned to them. So the channels table is not enough
; for keeping track of which numbers are in use.
(in_use space UINT8)
; Allocated size of the arrays.
......
Markdown is supported
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