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