aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/channel.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-07-14 14:28:33 -0400
committerNick Mathewson <nickm@torproject.org>2020-07-16 09:02:10 -0400
commitab428ef60b701075158f1c06676bcc394f0969b2 (patch)
treef5a800772ff36fa7d8b58fef917505d23bd8faca /src/core/or/channel.c
parent4f4785a8c113806d00c6a31154956edb86c1639f (diff)
downloadtor-ab428ef60b701075158f1c06676bcc394f0969b2.tar.gz
tor-ab428ef60b701075158f1c06676bcc394f0969b2.zip
Collapse channel_get_*_remote_addr() into a single function.
Since we can list the real address and the canonical one in a human-readable format we don't need to pick.
Diffstat (limited to 'src/core/or/channel.c')
-rw-r--r--src/core/or/channel.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/core/or/channel.c b/src/core/or/channel.c
index 2de164b39c..8390fc1ecc 100644
--- a/src/core/or/channel.c
+++ b/src/core/or/channel.c
@@ -2553,7 +2553,7 @@ channel_dump_statistics, (channel_t *chan, int severity))
/* Handle remote address and descriptions */
have_remote_addr = channel_get_addr_if_possible(chan, &remote_addr);
if (have_remote_addr) {
- char *actual = tor_strdup(channel_get_actual_remote_descr(chan));
+ char *actual = tor_strdup(channel_describe_peer(chan));
remote_addr_str = tor_addr_to_str_dup(&remote_addr);
tor_log(severity, LD_GENERAL,
" * Channel %"PRIu64 " says its remote address"
@@ -2561,18 +2561,18 @@ channel_dump_statistics, (channel_t *chan, int severity))
"actual description of \"%s\"",
(chan->global_identifier),
safe_str(remote_addr_str),
- safe_str(channel_get_canonical_remote_descr(chan)),
+ safe_str(channel_describe_peer(chan)),
safe_str(actual));
tor_free(remote_addr_str);
tor_free(actual);
} else {
- char *actual = tor_strdup(channel_get_actual_remote_descr(chan));
+ char *actual = tor_strdup(channel_describe_peer(chan));
tor_log(severity, LD_GENERAL,
" * Channel %"PRIu64 " does not know its remote "
"address, but gives a canonical description of \"%s\" and an "
"actual description of \"%s\"",
(chan->global_identifier),
- channel_get_canonical_remote_descr(chan),
+ channel_describe_peer(chan),
actual);
tor_free(actual);
}
@@ -2782,22 +2782,6 @@ channel_listener_dump_transport_statistics(channel_listener_t *chan_l,
}
/**
- * Return text description of the remote endpoint.
- *
- * This function return a test provided by the lower layer of the remote
- * endpoint for this channel; it should specify the actual address connected
- * to/from.
- *
- * Subsequent calls to channel_get_{actual,canonical}_remote_{address,descr}
- * may invalidate the return value from this function.
- */
-const char *
-channel_get_actual_remote_descr(channel_t *chan)
-{
- return channel_get_canonical_remote_descr(chan);
-}
-
-/**
* Return text description of the remote endpoint canonical address.
*
* This function returns a human-readable string for logging; nothing
@@ -2806,7 +2790,7 @@ channel_get_actual_remote_descr(channel_t *chan)
* Subsequent calls to this function may invalidate its return value.
*/
MOCK_IMPL(const char *,
-channel_get_canonical_remote_descr,(channel_t *chan))
+channel_describe_peer,(channel_t *chan))
{
tor_assert(chan);
tor_assert(chan->describe_peer);