Commit 0ec6f89d authored by Niels Möller's avatar Niels Möller

* src/connection.c (connection_close_handler): Moved from

connection_commands.c
(make_connection_close_handler): Likewise.

Rev: src/connection.c:1.60
Rev: src/connection.h:1.57
parent 557fd9ed
......@@ -381,6 +381,37 @@ connection_init_io(struct ssh_connection *connection,
: ssh_format("Sent")));
}
/* GABA:
(class
(name connection_close_handler)
(super lsh_callback)
(vars
(connection object ssh_connection)))
*/
static void
connection_die(struct lsh_callback *c)
{
CAST(connection_close_handler, closure, c);
verbose("Connection died.\n");
KILL_RESOURCE_LIST(closure->connection->resources);
}
struct lsh_callback *
make_connection_close_handler(struct ssh_connection *c)
{
NEW(connection_close_handler, closure);
closure->connection = c;
closure->super.f = connection_die;
return &closure->super;
}
/* Serialization. */
void connection_lock(struct ssh_connection *self)
......
......@@ -209,6 +209,9 @@ void connection_init_io(struct ssh_connection *connection,
struct abstract_write *raw,
struct randomness *r);
struct lsh_callback *
make_connection_close_handler(struct ssh_connection *c);
/* Serialization */
void connection_lock(struct ssh_connection *self);
void connection_unlock(struct ssh_connection *self);
......
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