Commit 9fd6b846 authored by Niels Möller's avatar Niels Möller
Browse files

* src/channel_commands.h (install_info): Inherit command_2,

instead of collect_info_2.

Rev: src/channel_commands.c:1.24
Rev: src/channel_commands.h:1.20
parent 23771282
...@@ -116,16 +116,17 @@ do_channel_global_command(struct command *s, ...@@ -116,16 +116,17 @@ do_channel_global_command(struct command *s,
C_WRITE(connection, request); C_WRITE(connection, request);
} }
struct lsh_object * void
do_install_global_request_handler(struct collect_info_2 *info, do_install_global_request_handler(struct command_2 *s,
struct lsh_object *a, struct lsh_object *a1,
struct lsh_object *b) struct lsh_object *a2,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{ {
CAST(install_info, self, info); CAST(install_info, self, s);
CAST(ssh_connection, connection, a); CAST(ssh_connection, connection, a1);
CAST_SUBTYPE(global_request, handler, b); CAST_SUBTYPE(global_request, handler, a2);
assert(!info->next);
assert(handler); assert(handler);
trace("Installing global request handler for '%a'\n", self->name); trace("Installing global request handler for '%a'\n", self->name);
...@@ -134,19 +135,20 @@ do_install_global_request_handler(struct collect_info_2 *info, ...@@ -134,19 +135,20 @@ do_install_global_request_handler(struct collect_info_2 *info,
self->name, self->name,
&handler->super); &handler->super);
return a; COMMAND_RETURN(c, connection);
} }
struct lsh_object * void
do_install_channel_open_handler(struct collect_info_2 *info, do_install_channel_open_handler(struct command_2 *s,
struct lsh_object *a, struct lsh_object *a1,
struct lsh_object *b) struct lsh_object *a2,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{ {
CAST(install_info, self, info); CAST(install_info, self, s);
CAST(ssh_connection, connection, a); CAST(ssh_connection, connection, a1);
CAST_SUBTYPE(channel_open, handler, b); CAST_SUBTYPE(channel_open, handler, a2);
assert(!info->next);
assert(handler); assert(handler);
trace("Installing channel open handler for '%a'\n", self->name); trace("Installing channel open handler for '%a'\n", self->name);
...@@ -155,9 +157,10 @@ do_install_channel_open_handler(struct collect_info_2 *info, ...@@ -155,9 +157,10 @@ do_install_channel_open_handler(struct collect_info_2 *info,
self->name, self->name,
&handler->super); &handler->super);
return a; COMMAND_RETURN(c, connection);
} }
/* Special cases, when the handler is known early */ /* Special cases, when the handler is known early */
/* Takes a connection as argument, and installs a fix handler */ /* Takes a connection as argument, and installs a fix handler */
......
...@@ -107,25 +107,29 @@ make_install_global_request_handler(UINT32 name, ...@@ -107,25 +107,29 @@ make_install_global_request_handler(UINT32 name,
/* GABA: /* GABA:
(class (class
(name install_info) (name install_info)
(super collect_info_2) (super command_2)
(vars (vars
(name . int))) (name . int)))
*/ */
struct lsh_object * void
do_install_global_request_handler(struct collect_info_2 *info, do_install_global_request_handler(struct command_2 *s,
struct lsh_object *a, struct lsh_object *a1,
struct lsh_object *b); struct lsh_object *a2,
struct lsh_object * struct command_continuation *c,
do_install_channel_open_handler(struct collect_info_2 *info, struct exception_handler *e);
struct lsh_object *a, void
struct lsh_object *b); do_install_channel_open_handler(struct command_2 *s,
struct lsh_object *a1,
struct lsh_object *a2,
struct command_continuation *c,
struct exception_handler *e);
#define STATIC_INSTALL_GLOBAL_HANDLER(atom) \ #define STATIC_INSTALL_GLOBAL_HANDLER(atom) \
{ STATIC_COLLECT_2_FINAL(do_install_global_request_handler),(atom) } { { { STATIC_HEADER, do_command_2 }, do_install_global_request_handler }, atom }
#define STATIC_INSTALL_OPEN_HANDLER(atom) \ #define STATIC_INSTALL_OPEN_HANDLER(atom) \
{ STATIC_COLLECT_2_FINAL(do_install_channel_open_handler),(atom) } { { { STATIC_HEADER, do_command_2 }, do_install_channel_open_handler }, atom }
struct command * struct command *
make_install_fix_global_request_handler(UINT32 name, make_install_fix_global_request_handler(UINT32 name,
......
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