aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-16 15:16:41 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-16 15:16:41 -0500
commit47aa491f9fbae38f71f96f50c4aec3f871c8419d (patch)
tree761284460160f16366540679826f87f3e07e78c7 /src/or
parent875a54dad3c4674cc1567d3154e0ccb191dfc0f0 (diff)
parent39850f03f627f4a12daf38ce68018f80feb52d81 (diff)
downloadtor-47aa491f9fbae38f71f96f50c4aec3f871c8419d.tar
tor-47aa491f9fbae38f71f96f50c4aec3f871c8419d.tar.gz
Merge remote-tracking branch 'asn-mytor/bug4751'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c2
-rw-r--r--src/or/config.h2
-rw-r--r--src/or/transports.c19
3 files changed, 12 insertions, 11 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 0763058d4..6ecc81db9 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -6857,7 +6857,7 @@ get_transport_bindaddr(const char *line, const char *transport)
* should bind on. The string is stored on the heap and must be freed
* by the caller of this function. */
char *
-get_bindaddr_for_transport(const char *transport)
+get_stored_bindaddr_for_server_transport(const char *transport)
{
char *default_addrport = NULL;
const char *stored_bindaddr = NULL;
diff --git a/src/or/config.h b/src/or/config.h
index 88258c133..0f7c61886 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -77,7 +77,7 @@ int options_need_geoip_info(const or_options_t *options,
void save_transport_to_state(const char *transport_name,
const tor_addr_t *addr, uint16_t port);
-char *get_bindaddr_for_transport(const char *transport);
+char *get_stored_bindaddr_for_server_transport(const char *transport);
int getinfo_helper_config(control_connection_t *conn,
const char *question, char **answer,
diff --git a/src/or/transports.c b/src/or/transports.c
index d8d2ff6aa..43e978a7c 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -912,11 +912,12 @@ parse_cmethod_line(const char *line, managed_proxy_t *mp)
return r;
}
-/** Return a string containing the address:port that <b>transport</b>
- * should use. It's the responsibility of the caller to free() the
- * received string. */
+/** Return the string that tor should place in TOR_PT_SERVER_BINDADDR
+ * while configuring the server managed proxy in <b>mp</b>. The
+ * string is stored in the heap, and it's the the responsibility of
+ * the caller to deallocate it after its use. */
static char *
-get_bindaddr_for_proxy(const managed_proxy_t *mp)
+get_bindaddr_for_server_proxy(const managed_proxy_t *mp)
{
char *bindaddr_result = NULL;
char *bindaddr_tmp = NULL;
@@ -925,7 +926,7 @@ get_bindaddr_for_proxy(const managed_proxy_t *mp)
tor_assert(mp->is_server);
SMARTLIST_FOREACH_BEGIN(mp->transports_to_launch, char *, t) {
- bindaddr_tmp = get_bindaddr_for_transport(t);
+ bindaddr_tmp = get_stored_bindaddr_for_server_transport(t);
smartlist_add_asprintf(string_tmp, "%s-%s", t, bindaddr_tmp);
@@ -996,7 +997,7 @@ set_managed_proxy_environment(LPVOID *envp, const managed_proxy_t *mp)
tor_asprintf(&orport_env, "TOR_PT_ORPORT=127.0.0.1:%s",
options->ORPort->value);
- bindaddr_tmp = get_bindaddr_for_proxy(mp);
+ bindaddr_tmp = get_bindaddr_for_server_proxy(mp);
tor_asprintf(&bindaddr_env, "TOR_PT_SERVER_BINDADDR=%s", bindaddr_tmp);
strcpy(extended_env, "TOR_PT_EXTENDED_SERVER_PORT=127.0.0.1:4200");
@@ -1079,7 +1080,7 @@ set_managed_proxy_environment(char ***envp, const managed_proxy_t *mp)
tor_asprintf(tmp++, "TOR_PT_STATE_LOCATION=%s", state_loc);
tor_asprintf(tmp++, "TOR_PT_MANAGED_TRANSPORT_VER=1"); /* temp */
if (mp->is_server) {
- bindaddr = get_bindaddr_for_proxy(mp);
+ bindaddr = get_bindaddr_for_server_proxy(mp);
/* XXX temp */
tor_asprintf(tmp++, "TOR_PT_ORPORT=127.0.0.1:%d",
@@ -1131,8 +1132,8 @@ managed_proxy_create(const smartlist_t *transport_list,
return mp;
}
-/** Register <b>transport</b> using proxy with <b>proxy_argv</b> to
- * the managed proxy subsystem.
+/** Register proxy with <b>proxy_argv</b>, supporting transports in
+ * <b>transport_list</b>, to the managed proxy subsystem.
* If <b>is_server</b> is true, then the proxy is a server proxy. */
void
pt_kickstart_proxy(const smartlist_t *transport_list,