From ea3e9416c6c579735ff2b844a88605ae5e1cbbd2 Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Fri, 12 Aug 2011 21:33:05 +0200 Subject: Spawn multiple protocols using a single managed proxy. If multiple torrc transport lines have the same argv, tor instructs a single managed proxy to launch multiple protocols. --- src/or/transports.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/or/transports.h') diff --git a/src/or/transports.h b/src/or/transports.h index 8bd79fe64..c75797d21 100644 --- a/src/or/transports.h +++ b/src/or/transports.h @@ -11,13 +11,13 @@ #ifndef TOR_TRANSPORTS_H #define TOR_TRANSPORTS_H -int pt_managed_launch_proxy(const char *method, - char **proxy_argv, int is_server); +void pt_kickstart_proxy(char *method, char **proxy_argv, + int is_server); -#define pt_managed_launch_client_proxy(m, pa) \ - pt_managed_launch_proxy(m, pa, 0) -#define pt_managed_launch_server_proxy(m, pa) \ - pt_managed_launch_proxy(m, pa, 1) +#define pt_kickstart_client_proxy(m, pa) \ + pt_kickstart_proxy(m, pa, 0) +#define pt_kickstart_server_proxy(m, pa) \ + pt_kickstart_proxy(m, pa, 1) void pt_configure_remaining_proxies(void); @@ -29,6 +29,7 @@ void pt_free_all(void); /** State of the managed proxy configuration protocol. */ enum pt_proto_state { PT_PROTO_INFANT, /* was just born */ + PT_PROTO_LAUNCHED, /* was just launched */ PT_PROTO_ACCEPTING_METHODS, /* accepting methods */ PT_PROTO_CONFIGURED, /* configured successfully */ PT_PROTO_COMPLETED, /* configure and registered its transports */ @@ -38,6 +39,7 @@ enum pt_proto_state { /** Structure containing information of a managed proxy. */ typedef struct { enum pt_proto_state conf_state; /* the current configuration state */ + char **argv; /* the cli arguments of this proxy */ int conf_protocol; /* the configuration protocol version used */ int is_server; /* is it a server proxy? */ @@ -45,7 +47,8 @@ typedef struct { FILE *stdout; /* a stream to its stdout (closed in managed_proxy_destroy()) */ - smartlist_t *transports; /* list of transport_t this proxy spawns */ + smartlist_t *transports_to_launch; /* transports to-be-launched by this proxy */ + smartlist_t *transports; /* list of transport_t this proxy spawned */ } managed_proxy_t; int parse_cmethod_line(char *line, managed_proxy_t *mp); -- cgit v1.2.3