Commit 63fe1115 authored by Niels Möller's avatar Niels Möller

* src/gateway_commands.c: Hacked some more. Compiles now.

Rev: src/gateway_commands.c:1.2
parent acd5b14d
......@@ -22,7 +22,22 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* #include "gateway.h" */
#include "channel.h"
#include "connection_commands.h"
#include "io.h"
#include "read_packet.h"
#include "ssh.h"
#include "werror.h"
#include "xalloc.h"
#include "gateway_commands.c.x"
/* FIXME: Same vars as connection_remember_command */
/* (gateway_accept connection listen_value) */
/* GABA:
(class
(name gateway_accept_command)
......@@ -31,6 +46,12 @@
(connection object ssh_connection)))
*/
/* Buffer size when reading from the socket */
#define BUF_SIZE (1<<14)
/* Blocksize when writing */
#define BLOCK_SIZE 2000
static void
do_gateway_accept(struct command *s,
struct lsh_object *x,
......@@ -46,11 +67,19 @@ do_gateway_accept(struct command *s,
NULL, /* established_continuation */
make_exc_finish_read_handler(lv->fd, e, HANDLER_CONTEXT));
connection->raw
= &io_read_write(lv->fd,
make_buffered_read
(BUF_SIZE,
make_read_packet(connection, &connection->super)),
self->info->block_size,
make_connection_close_handler(connection));
connection->raw =
&io_read_write(lv->fd,
make_buffered_read
(BUF_SIZE,
make_read_packet(&connection->super, connection)),
BLOCK_SIZE,
make_connection_close_handler(connection))->write_buffer->super;
connection->chain = self->connection;
connection->dispatch[SSH_MSG_DEBUG] = &connection_forward_handler;
connection->dispatch[SSH_MSG_IGNORE] = &connection_forward_handler;
init_connection_service(connection);
COMMAND_RETURN(c, connection);
}
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