diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-14 14:26:24 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-16 09:02:10 -0400 |
commit | 4f4785a8c113806d00c6a31154956edb86c1639f (patch) | |
tree | a4f33dada8ef81fd7b1942da72fe86882f233898 /src/core/or/channel.c | |
parent | f9aafcd64e69d602eb4284e530fe9b8973cf7406 (diff) | |
download | tor-4f4785a8c113806d00c6a31154956edb86c1639f.tar.gz tor-4f4785a8c113806d00c6a31154956edb86c1639f.zip |
Refactor channel description internals.
Now that we've clarified that these functions only need to describe
the peer in a human-readable way, we can have them delegate to
connection_describe_peer().
Diffstat (limited to 'src/core/or/channel.c')
-rw-r--r-- | src/core/or/channel.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/core/or/channel.c b/src/core/or/channel.c index 5ea38256ac..2de164b39c 100644 --- a/src/core/or/channel.c +++ b/src/core/or/channel.c @@ -2794,31 +2794,24 @@ channel_listener_dump_transport_statistics(channel_listener_t *chan_l, const char * channel_get_actual_remote_descr(channel_t *chan) { - tor_assert(chan); - tor_assert(chan->get_remote_descr); - - /* Param 1 indicates the actual description */ - return chan->get_remote_descr(chan, GRD_FLAG_ORIGINAL); + return channel_get_canonical_remote_descr(chan); } /** * Return text description of the remote endpoint canonical address. * - * This function return a test provided by the lower layer of the remote - * endpoint for this channel; it should use the known canonical address for - * this OR's identity digest if possible. + * This function returns a human-readable string for logging; nothing + * should parse it or rely on a particular format. * - * Subsequent calls to channel_get_{actual,canonical}_remote_{address,descr} - * may invalidate the return value from this function. + * Subsequent calls to this function may invalidate its return value. */ MOCK_IMPL(const char *, channel_get_canonical_remote_descr,(channel_t *chan)) { tor_assert(chan); - tor_assert(chan->get_remote_descr); + tor_assert(chan->describe_peer); - /* Param 0 indicates the canonicalized description */ - return chan->get_remote_descr(chan, 0); + return chan->describe_peer(chan); } /** |