commit 1dc4f96d9c630aa562a15958b29848a25b458c84 Author: David Goulet dgoulet@torproject.org Date: Tue Nov 21 15:13:20 2017 -0500
channel: Remove nickname attribute from channel_t
This was never set thus never could have been used. Get rid of it to simplify the code.
Signed-off-by: David Goulet dgoulet@torproject.org --- src/or/channel.c | 40 +++++++++++----------------------------- src/or/channel.h | 3 --- src/or/circuitbuild.c | 3 +-- src/or/circuitlist.c | 3 +-- 4 files changed, 13 insertions(+), 36 deletions(-)
diff --git a/src/or/channel.c b/src/or/channel.c index 3a08d4cb0..ffa827064 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -1389,7 +1389,7 @@ channel_set_identity_digest(channel_t *chan, }
/** - * Clear the remote end metadata (identity_digest/nickname) of a channel + * Clear the remote end metadata (identity_digest) of a channel * * This function clears all the remote end info from a channel; this is * intended for use by the lower layer. @@ -1416,7 +1416,6 @@ channel_clear_remote_end(channel_t *chan)
memset(chan->identity_digest, 0, sizeof(chan->identity_digest)); - tor_free(chan->nickname); }
/** @@ -2583,35 +2582,18 @@ channel_dump_statistics, (channel_t *chan, int severity)) U64_PRINTF_ARG(chan->timestamp_active), U64_PRINTF_ARG(now - chan->timestamp_active));
- /* Handle digest and nickname */ + /* Handle digest. */ if (!tor_digest_is_zero(chan->identity_digest)) { - if (chan->nickname) { - tor_log(severity, LD_GENERAL, - " * Channel " U64_FORMAT " says it is connected " - "to an OR with digest %s and nickname %s", - U64_PRINTF_ARG(chan->global_identifier), - hex_str(chan->identity_digest, DIGEST_LEN), - chan->nickname); - } else { - tor_log(severity, LD_GENERAL, - " * Channel " U64_FORMAT " says it is connected " - "to an OR with digest %s and no known nickname", - U64_PRINTF_ARG(chan->global_identifier), - hex_str(chan->identity_digest, DIGEST_LEN)); - } + tor_log(severity, LD_GENERAL, + " * Channel " U64_FORMAT " says it is connected " + "to an OR with digest %s", + U64_PRINTF_ARG(chan->global_identifier), + hex_str(chan->identity_digest, DIGEST_LEN)); } else { - if (chan->nickname) { - tor_log(severity, LD_GENERAL, - " * Channel " U64_FORMAT " does not know the digest" - " of the OR it is connected to, but reports its nickname is %s", - U64_PRINTF_ARG(chan->global_identifier), - chan->nickname); - } else { - tor_log(severity, LD_GENERAL, - " * Channel " U64_FORMAT " does not know the digest" - " or the nickname of the OR it is connected to", - U64_PRINTF_ARG(chan->global_identifier)); - } + tor_log(severity, LD_GENERAL, + " * Channel " U64_FORMAT " does not know the digest" + " of the OR it is connected to", + U64_PRINTF_ARG(chan->global_identifier)); }
/* Handle remote address and descriptions */ diff --git a/src/or/channel.h b/src/or/channel.h index 1dc378b3d..5a2457faf 100644 --- a/src/or/channel.h +++ b/src/or/channel.h @@ -255,9 +255,6 @@ struct channel_s { */ ed25519_public_key_t ed25519_identity;
- /** Nickname of the OR on the other side, or NULL if none. */ - char *nickname; - /** * Linked list of channels with the same RSA identity digest, for use with * the digest->channel map diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 2e6b63b4d..4e9d2457c 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -631,8 +631,7 @@ circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits)
tor_assert(chan);
- log_debug(LD_CIRC,"chan to %s/%s, status=%d", - chan->nickname ? chan->nickname : "NULL", + log_debug(LD_CIRC,"chan to %s, status=%d", channel_get_canonical_remote_descr(chan), status);
pending_circs = smartlist_new(); diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index d37d986f1..c879fdada 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -505,8 +505,7 @@ circuit_count_pending_on_channel(channel_t *chan) circuit_get_all_pending_on_channel(sl, chan); cnt = smartlist_len(sl); smartlist_free(sl); - log_debug(LD_CIRC,"or_conn to %s at %s, %d pending circs", - chan->nickname ? chan->nickname : "NULL", + log_debug(LD_CIRC,"or_conn to %s, %d pending circs", channel_get_canonical_remote_descr(chan), cnt); return cnt;
tor-commits@lists.torproject.org