diff options
author | Alexander Færøy <ahf@torproject.org> | 2023-07-21 02:11:16 +0200 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2024-06-18 15:15:20 -0400 |
commit | b4f8518f8fdedc2711cbaad0abb5a4b85bf66fec (patch) | |
tree | bfb859d74935fe91090b105402b891f69b0684a8 | |
parent | f45934448849a931be09aed7dd0ac3d275b218e4 (diff) | |
download | tor-b4f8518f8fdedc2711cbaad0abb5a4b85bf66fec.tar.gz tor-b4f8518f8fdedc2711cbaad0abb5a4b85bf66fec.zip |
Add implementation and version metadata to bridge extra-info.
This patch adds two new keys to bridges' extra-info document:
"transport-version" and "transport-implementation".
These two new values always appear together (if one is missing, the
other one will be missing too) and is parsed from PT's STATUS
TYPE=version messages.
See: tpo/core/tor#11101.
-rw-r--r-- | src/feature/client/transports.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c index 416e538efc..77cee25c54 100644 --- a/src/feature/client/transports.c +++ b/src/feature/client/transports.c @@ -1786,9 +1786,21 @@ pt_get_extra_info_descriptor_string(void) "transport %s %s%s", t->name, addrport, transport_args ? transport_args : ""); + tor_free(transport_args); } SMARTLIST_FOREACH_END(t); + if (mp->version != NULL) { + smartlist_add_asprintf(string_chunks, + "transport-version %s", + mp->version); + } + + if (mp->implementation != NULL) { + smartlist_add_asprintf(string_chunks, + "transport-implementation %s", + mp->implementation); + } } SMARTLIST_FOREACH_END(mp); if (smartlist_len(string_chunks) == 0) { |