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>
This commit is contained in:
David Goulet 2017-11-21 15:13:20 -05:00
parent 163477b11e
commit 1dc4f96d9c
4 changed files with 13 additions and 36 deletions

View file

@ -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 * This function clears all the remote end info from a channel; this is
* intended for use by the lower layer. * intended for use by the lower layer.
@ -1416,7 +1416,6 @@ channel_clear_remote_end(channel_t *chan)
memset(chan->identity_digest, 0, memset(chan->identity_digest, 0,
sizeof(chan->identity_digest)); sizeof(chan->identity_digest));
tor_free(chan->nickname);
} }
/** /**
@ -2583,36 +2582,19 @@ channel_dump_statistics, (channel_t *chan, int severity))
U64_PRINTF_ARG(chan->timestamp_active), U64_PRINTF_ARG(chan->timestamp_active),
U64_PRINTF_ARG(now - 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 (!tor_digest_is_zero(chan->identity_digest)) {
if (chan->nickname) {
tor_log(severity, LD_GENERAL, tor_log(severity, LD_GENERAL,
" * Channel " U64_FORMAT " says it is connected " " * Channel " U64_FORMAT " says it is connected "
"to an OR with digest %s and nickname %s", "to an OR with digest %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), U64_PRINTF_ARG(chan->global_identifier),
hex_str(chan->identity_digest, DIGEST_LEN)); 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 { } else {
tor_log(severity, LD_GENERAL, tor_log(severity, LD_GENERAL,
" * Channel " U64_FORMAT " does not know the digest" " * Channel " U64_FORMAT " does not know the digest"
" or the nickname of the OR it is connected to", " of the OR it is connected to",
U64_PRINTF_ARG(chan->global_identifier)); U64_PRINTF_ARG(chan->global_identifier));
} }
}
/* Handle remote address and descriptions */ /* Handle remote address and descriptions */
have_remote_addr = channel_get_addr_if_possible(chan, &remote_addr); have_remote_addr = channel_get_addr_if_possible(chan, &remote_addr);

View file

@ -255,9 +255,6 @@ struct channel_s {
*/ */
ed25519_public_key_t ed25519_identity; 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 * Linked list of channels with the same RSA identity digest, for use with
* the digest->channel map * the digest->channel map

View file

@ -631,8 +631,7 @@ circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits)
tor_assert(chan); tor_assert(chan);
log_debug(LD_CIRC,"chan to %s/%s, status=%d", log_debug(LD_CIRC,"chan to %s, status=%d",
chan->nickname ? chan->nickname : "NULL",
channel_get_canonical_remote_descr(chan), status); channel_get_canonical_remote_descr(chan), status);
pending_circs = smartlist_new(); pending_circs = smartlist_new();

View file

@ -505,8 +505,7 @@ circuit_count_pending_on_channel(channel_t *chan)
circuit_get_all_pending_on_channel(sl, chan); circuit_get_all_pending_on_channel(sl, chan);
cnt = smartlist_len(sl); cnt = smartlist_len(sl);
smartlist_free(sl); smartlist_free(sl);
log_debug(LD_CIRC,"or_conn to %s at %s, %d pending circs", log_debug(LD_CIRC,"or_conn to %s, %d pending circs",
chan->nickname ? chan->nickname : "NULL",
channel_get_canonical_remote_descr(chan), channel_get_canonical_remote_descr(chan),
cnt); cnt);
return cnt; return cnt;