diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-07-02 19:33:55 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-07-18 08:43:52 -0400 |
commit | 924946aaafd75a657ae1fd0da95f9e95d19975ca (patch) | |
tree | eb91d86d0fb38a97bfd66e1ab37b51fe14a124c0 /src/or/transports.c | |
parent | 8bb2ba13c1cc45d5979c1a3eaeed899e29991aed (diff) | |
download | tor-924946aaafd75a657ae1fd0da95f9e95d19975ca.tar.gz tor-924946aaafd75a657ae1fd0da95f9e95d19975ca.zip |
Write transport ARGS to extra-info descriptor.
Diffstat (limited to 'src/or/transports.c')
-rw-r--r-- | src/or/transports.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/or/transports.c b/src/or/transports.c index d1c34b5854..91234210b2 100644 --- a/src/or/transports.c +++ b/src/or/transports.c @@ -1404,6 +1404,8 @@ pt_get_extra_info_descriptor_string(void) tor_assert(mp->transports); SMARTLIST_FOREACH_BEGIN(mp->transports, const transport_t *, t) { + char *transport_args = NULL; + /* If the transport proxy returned "0.0.0.0" as its address, and * we know our external IP address, use it. Otherwise, use the * returned address. */ @@ -1419,9 +1421,16 @@ pt_get_extra_info_descriptor_string(void) addrport = fmt_addrport(&t->addr, t->port); } + /* If this transport has any arguments with it, prepend a space + to them so that we can add them to the transport line. */ + if (t->extra_info_args) + tor_asprintf(&transport_args, " %s", t->extra_info_args); + smartlist_add_asprintf(string_chunks, - "transport %s %s", - t->name, addrport); + "transport %s %s%s", + t->name, addrport, + transport_args ? transport_args : ""); + tor_free(transport_args); } SMARTLIST_FOREACH_END(t); } SMARTLIST_FOREACH_END(mp); |