Commit 2bcce13b authored by Niels Möller's avatar Niels Möller
Browse files

* src/tcpforward_commands.c (new_tcpip_channel): Leave the

REMEMBER_RESOURCE call for make_tcpip_channel().

* src/tcpforward.c (make_tcpip_channel): Call REMEMBER_RESOURCE().

Rev: src/tcpforward.c:1.50
Rev: src/tcpforward_commands.c:1.27
parent a453f6ec
......@@ -149,6 +149,7 @@ do_tcpip_eof(struct ssh_channel *c)
channel_close(c);
}
/* NOTE: Add's the socket to the channel's resource list */
struct ssh_channel *
make_tcpip_channel(struct lsh_fd *socket, UINT32 initial_window)
{
......@@ -168,6 +169,8 @@ make_tcpip_channel(struct lsh_fd *socket, UINT32 initial_window)
self->super.rec_max_packet = SSH_MAX_PACKET - SSH_CHANNEL_MAX_PACKET_FUZZ;
self->socket = socket;
REMEMBER_RESOURCE(self->super.resources, socket);
return &self->super;
}
......@@ -178,7 +181,8 @@ make_tcpip_channel(struct lsh_fd *socket, UINT32 initial_window)
* (channel_open_continuation has not yet done its work), and we can't
* send any packets. */
void tcpip_channel_start_io(struct ssh_channel *c)
void
tcpip_channel_start_io(struct ssh_channel *c)
{
CAST(tcpip_channel, channel, c);
......
......@@ -76,7 +76,7 @@ static struct catch_report_collect catch_channel_open
#define TCPIP_WINDOW_SIZE 10000
/* NOTE: This command does not do any remembering. */
/* NOTE: make_tcpip_channel() adds the fd to the channel's resource list. */
static void
do_tcpip_connect_io(struct command *ignored UNUSED,
struct lsh_object *x,
......@@ -150,15 +150,14 @@ new_tcpip_channel(struct channel_open_command *c,
struct ssh_channel *channel;
/* NOTE: All accepted fd:s must end up in this function, so it
* should be ok to delay the REMEMBER() call until here. */
* should be ok to delay the REMEMBER() call until here. It is done
* by make_tcpip_channel(). */
debug("tcpforward_commands.c: new_tcpip_channel()\n");
channel = make_tcpip_channel(self->peer->fd, TCPIP_WINDOW_SIZE);
channel->write = connection->write;
REMEMBER_RESOURCE(channel->resources, &self->peer->fd->super);
*request = format_channel_open(self->type, local_channel_number,
channel,
"%S%i%S%i",
......
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