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

* src/proxy.c (chain_connections): Redefined using DEFINE_COMMAND3.

Rev: src/proxy.c:1.12
Rev: src/proxy.h:1.5
parent 6cee286e
...@@ -180,57 +180,22 @@ make_chain_connections_client(struct command *client_callback, ...@@ -180,57 +180,22 @@ make_chain_connections_client(struct command *client_callback,
return &self->super.super; return &self->super.super;
} }
/* GABA: DEFINE_COMMAND3(chain_connections)
(class (struct lsh_object *a1,
(name chain_connections) struct lsh_object *a2,
(super command) struct lsh_object *a3,
(server_callback object command)
(client_callback object command)))
static void
do_chain_connections(struct command *s,
struct lsh_object *x,
struct command_continuation *c, struct command_continuation *c,
struct exception_handler *e) struct exception_handler *e)
{ {
CAST(chain_connections, self, s); CAST_SUBTYPE(command, server_callback, a1);
CAST(listen_value, client_addr, x); CAST_SUBTYPE(command, client_callback, a2);
CAST(listen_value, client_addr, a3);
COMMAND_CALL(self->server_callback, &client_addr->super, COMMAND_CALL(server_callback, &client_addr->super,
make_chain_connections_client(self->client_callback, client_addr, c, e), make_chain_connections_client(client_callback, client_addr, c, e),
e); e);
} }
static struct command *
make_chain_connections(struct command *server_callback,
struct command *client_callback)
NEW(chain_connections, self);
self-> = do_chain_connections;
self->server_callback = server_callback;
self->client_callback = client_callback;
return &self->super;
static struct lsh_object *
do_collect_chain_params(struct collect_info_2 *info UNUSED,
struct lsh_object *a,
struct lsh_object *b)
CAST_SUBTYPE(command, server_callback, a);
CAST_SUBTYPE(command, client_callback, b);
return &make_chain_connections(server_callback, client_callback)->super;
struct collect_info_2 chain_connections_2 =
struct collect_info_1 chain_connections =
/* (proxy_connection_service user connection) -> connection */ /* (proxy_connection_service user connection) -> connection */
/* GABA: /* GABA:
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#include "alist.h" #include "alist.h"
#include "command.h" #include "command.h"
extern struct collect_info_1 chain_connections; extern struct command_3 chain_connections;
#define CHAIN_CONNECTIONS (&chain_connections.super.super.super) #define CHAIN_CONNECTIONS (&chain_connections.super.super)
struct command * struct command *
make_proxy_connection_service(struct object_list *server_hooks, make_proxy_connection_service(struct object_list *server_hooks,
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