Commit 4027d5f6 authored by Niels Möller's avatar Niels Möller
Browse files

(channel_forward_start_io_read): New function.

Rev: src/channel_forward.c:1.14
Rev: src/channel_forward.h:1.8
parent 827a57d4
......@@ -140,6 +140,23 @@ channel_forward_start_io(struct channel_forward *channel)
channel->socket->write_buffer->report = &channel->super.super;
}
/* Like above, but doesn't install a new write buffer. Used by the socks server. */
void
channel_forward_start_io_read(struct channel_forward *channel)
{
channel->super.receive = do_channel_forward_receive;
channel->super.send_adjust = do_channel_forward_send_adjust;
channel->super.eof = do_channel_forward_eof;
/* Install callbacks on the local socket. Leave write callbacks alone */
io_read(channel->socket,
make_channel_read_data(&channel->super),
make_channel_read_close_callback(&channel->super));
/* Flow control */
channel->socket->write_buffer->report = &channel->super.super;
}
/* Used by the party requesting tcp forwarding, i.e. when a socket is
* already open, and we have asked the other end to forward it. Takes
* a channel as argument, and connects it to the socket. Returns the
......
......@@ -50,6 +50,9 @@ make_channel_forward(struct lsh_fd *socket, uint32_t initial_window);
void
channel_forward_start_io(struct channel_forward *channel_forward);
void
channel_forward_start_io_read(struct channel_forward *channel);
extern struct command start_io_command;
#define START_IO (&start_io_command.super)
......
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