Commit 8f898fd8 authored by Niels Möller's avatar Niels Möller
Browse files

Decided to make the connection object the central point for

dispatching packets and keeping various state.

Rev: src/connection.c:1.3
Rev: src/connection.h:1.7
parent 648d39ff
......@@ -7,12 +7,25 @@
#include "ssh.h"
#include "format.h"
struct ssh_connection *ssh_connection_alloc()
static int handle_connection(struct abstract_write **w,
struct lsh_String *packet)
struct ssh_connection *connection = xalloc(sizeof(struct ssh_connection));
struct ssh_connection *closure = (struct ssh_connection *) *w;
/* First handle special messages: debug, ignore, disconnect, ... */
/* Next see if we are expecting a newkey message */
memset(connection, 0, sizeof(struct ssh_connection));
/* Dispatch by packet type, and later by channel number */
struct abstract_write *make_ssh_connection()
struct ssh_connection *connection = xalloc(sizeof(struct ssh_connection));
connection->super.write = handle_connection;
connection->max_packet = 0x8000;
return connection;
......@@ -10,6 +10,8 @@
struct ssh_connection
struct abstract_write super;
/* Sent and recieved version strings */
struct lsh_string *client_version;
struct lsh_string *server_version;
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