aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2024-06-11 12:38:56 -0400
committerDavid Goulet <dgoulet@torproject.org>2024-06-18 15:15:32 -0400
commitd587ba01a70b81e8c15f6e53e72c133ebe977719 (patch)
treee84a0f16c25ee839229cd26c125576bbe78f5394 /src/feature
parent1941f25f4ccdab3f0a94ccac8232c958153e3f2a (diff)
downloadtor-d587ba01a70b81e8c15f6e53e72c133ebe977719.tar.gz
tor-d587ba01a70b81e8c15f6e53e72c133ebe977719.zip
bridge: Always put transport-info line
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/client/transports.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index 403bedc183..878675ac4d 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -1798,20 +1798,21 @@ pt_get_extra_info_descriptor_string(void)
/* Set transport-info line. */
{
- char *transport_info_args = NULL;
+ char *version = NULL;
+ char *impl = NULL;
if (mp->version) {
- tor_asprintf(&transport_info_args, " version=%s", mp->version);
+ tor_asprintf(&version, " version=%s", mp->version);
}
if (mp->implementation) {
- tor_asprintf(&transport_info_args, " implementation=%s",
- mp->implementation);
- }
- if (transport_info_args) {
- smartlist_add_asprintf(string_chunks, "transport-info%s",
- transport_info_args ? transport_info_args : "");
- tor_free(transport_info_args);
+ tor_asprintf(&impl, " implementation=%s", mp->implementation);
}
+ /* Always put in the line even if empty. Else, we don't know to which
+ * transport this applies to. */
+ smartlist_add_asprintf(string_chunks, "transport-info%s%s",
+ version ? version: "", impl ? impl: "");
+ tor_free(version);
+ tor_free(impl);
}
} SMARTLIST_FOREACH_END(mp);