Commit c53b3377 authored by Niels Möller's avatar Niels Möller

Use new connection object.

Rev: src/client.c:1.10
Rev: src/server.c:1.3
parent 6dc20a81
......@@ -28,8 +28,9 @@ static int client_initiate(struct fd_callback **c,
{
struct client_callback *closure
= (struct client_callback *) *c;
struct ssh_connection *connection = ssh_connection_alloc();
/* FIXME: Should pass a key exchange handler, not NULL! */
struct ssh_connection *connection = make_ssh_connection(NULL);
connection->raw =
io_read_write(closure->backend, fd,
make_client_read_line(),
......@@ -60,11 +61,6 @@ struct client_line_handler
struct ssh_connection *connection;
};
struct abstract_write *make_client_dispatch(struct ssh_connection *c)
{ /* FIXME: HERE */
return make_packet_void();
}
static struct read_handler *do_line(struct line_handler **h,
UINT32 length,
UINT8 *line)
......@@ -81,7 +77,7 @@ static struct read_handler *do_line(struct line_handler **h,
struct read_handler *new
= make_read_packet
(make_packet_debug
(make_packet_unpad(make_client_dispatch(closure->connection)),
(make_packet_unpad(&closure->connection->super),
stderr),
closure->connection->max_packet);
......@@ -109,7 +105,7 @@ static struct read_handler *do_line(struct line_handler **h,
/* FIXME: Clean up properly */
lsh_free(closure);
*h = 0;
*h = NULL;
return 0;
}
......
......@@ -23,7 +23,8 @@ static int server_initiate(struct fd_callback **c,
{
struct server_callback *closure = (struct server_callback *) *c;
struct ssh_connection *connection = ssh_connection_alloc();
/* FIXME: Should pass a key exchange handler, not NULL! */
struct ssh_connection *connection = make_ssh_connection(NULL);
struct abstract_write *write =
io_read_write(closure->backend, fd,
make_server_read_line(),
......@@ -57,7 +58,7 @@ static struct read_handler *do_line(struct line_handler **h,
if ((length >= 8) && !memcmp(line + 4, "2.0-", 4))
{
struct read_handler *new
= make_read_packet(make_packet_debug(make_packet_void(),
= make_read_packet(make_packet_debug(&closure->connection->super,
stderr),
closure->connection->max_packet);
......
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