From: Andrea Shepard Date: Tue, 9 Oct 2012 02:52:04 +0000 (-0700) Subject: Abolish superfluous channel_find_by_remote_nickname() X-Git-Tag: tor-0.2.4.4-alpha~37^2~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=965c9de498ab7f6c7ce3dce133bb34456f3d668e;p=thirdparty%2Ftor.git Abolish superfluous channel_find_by_remote_nickname() --- diff --git a/src/or/channel.c b/src/or/channel.c index 690bfb92a7..9b814bb655 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -609,42 +609,6 @@ channel_find_by_remote_digest(const char *identity_digest) return rv; } -/** - * Find channel by remote nickname - * - * This function looks up a channel by the nickname of the remote - * endpoint. It's possible that more than one channel to that endpoint - * nickname exists, but there is not currently any supported way to iterate - * them. Use digests. - * - * @param nickname A node nickname - * @return A channel pointer to a channel to a node with that nickname, or - * NULL if none is available. - */ - -channel_t * -channel_find_by_remote_nickname(const char *nickname) -{ - channel_t *rv = NULL; - - tor_assert(nickname); - - if (all_channels && smartlist_len(all_channels) > 0) { - SMARTLIST_FOREACH_BEGIN(all_channels, channel_t *, curr) { - if (!(curr->is_listener)) { - if (curr->u.cell_chan.nickname && - strncmp(curr->u.cell_chan.nickname, nickname, - MAX_NICKNAME_LEN) == 0) { - rv = curr; - break; - } - } - } SMARTLIST_FOREACH_END(curr); - } - - return rv; -} - /** * Next channel with digest * diff --git a/src/or/channel.h b/src/or/channel.h index ed69b9200e..70759818fe 100644 --- a/src/or/channel.h +++ b/src/or/channel.h @@ -368,7 +368,6 @@ int channel_is_better(time_t now, channel_t * channel_find_by_global_id(uint64_t global_identifier); channel_t * channel_find_by_remote_digest(const char *identity_digest); -channel_t * channel_find_by_remote_nickname(const char *nickname); /** For things returned by channel_find_by_remote_digest(), walk the list. */