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 = NULL;
+ char *bindaddr_result = NULL;
char *bindaddr_tmp = NULL;
smartlist_t *string_tmp = smartlist_create();
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);
- tor_asprintf(&bindaddr, "%s-%s", t, bindaddr_tmp);
- smartlist_add(string_tmp, bindaddr);
+ smartlist_add_asprintf(string_tmp, "%s-%s", t, bindaddr_tmp);
tor_free(bindaddr_tmp);
} SMARTLIST_FOREACH_END(t);