mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
If we have a routerstatus but no routerinfo to name a router, use the routerstatus instead when generating circuit events. Also refactor a little.
svn:r19078
This commit is contained in:
parent
e591aafca4
commit
a335b43a67
@ -13,6 +13,12 @@ Changes in version 0.2.1.14-??? - 2009-03-??
|
|||||||
- Avoid double-free on list of successfully uploaded hidden
|
- Avoid double-free on list of successfully uploaded hidden
|
||||||
service discriptors. Fix for bug 948. Bugfix on 0.2.1.6-alpha.
|
service discriptors. Fix for bug 948. Bugfix on 0.2.1.6-alpha.
|
||||||
|
|
||||||
|
o Minor features (controller):
|
||||||
|
- Try harder to look up nicknames for routers on a circuit when
|
||||||
|
generating circuit events with verbose nicknames. (Previously, we
|
||||||
|
would look in the router descriptors we had for nicknames, but not
|
||||||
|
in the consensus.) Partial fix for bug 941.
|
||||||
|
|
||||||
|
|
||||||
Changes in version 0.2.1.13-alpha - 2009-03-09
|
Changes in version 0.2.1.13-alpha - 2009-03-09
|
||||||
Tor 0.2.1.13-alpha includes another big pile of minor bugfixes and
|
Tor 0.2.1.13-alpha includes another big pile of minor bugfixes and
|
||||||
|
@ -133,39 +133,41 @@ circuit_list_path_impl(origin_circuit_t *circ, int verbose, int verbose_names)
|
|||||||
hop = circ->cpath;
|
hop = circ->cpath;
|
||||||
do {
|
do {
|
||||||
routerinfo_t *ri;
|
routerinfo_t *ri;
|
||||||
|
routerstatus_t *rs;
|
||||||
char *elt;
|
char *elt;
|
||||||
|
const char *id;
|
||||||
if (!hop)
|
if (!hop)
|
||||||
break;
|
break;
|
||||||
|
id = hop->extend_info->identity_digest;
|
||||||
if (!verbose && hop->state != CPATH_STATE_OPEN)
|
if (!verbose && hop->state != CPATH_STATE_OPEN)
|
||||||
break;
|
break;
|
||||||
if (!hop->extend_info)
|
if (!hop->extend_info)
|
||||||
break;
|
break;
|
||||||
if (verbose_names) {
|
if (verbose_names) {
|
||||||
elt = tor_malloc(MAX_VERBOSE_NICKNAME_LEN+1);
|
elt = tor_malloc(MAX_VERBOSE_NICKNAME_LEN+1);
|
||||||
if ((ri = router_get_by_digest(hop->extend_info->identity_digest))) {
|
if ((ri = router_get_by_digest(id))) {
|
||||||
router_get_verbose_nickname(elt, ri);
|
router_get_verbose_nickname(elt, ri);
|
||||||
|
} else if ((rs = router_get_consensus_status_by_id(id))) {
|
||||||
|
routerstatus_get_verbose_nickname(elt, rs);
|
||||||
} else if (hop->extend_info->nickname &&
|
} else if (hop->extend_info->nickname &&
|
||||||
is_legal_nickname(hop->extend_info->nickname)) {
|
is_legal_nickname(hop->extend_info->nickname)) {
|
||||||
elt[0] = '$';
|
elt[0] = '$';
|
||||||
base16_encode(elt+1, HEX_DIGEST_LEN+1,
|
base16_encode(elt+1, HEX_DIGEST_LEN+1, id, DIGEST_LEN);
|
||||||
hop->extend_info->identity_digest, DIGEST_LEN);
|
|
||||||
elt[HEX_DIGEST_LEN+1]= '~';
|
elt[HEX_DIGEST_LEN+1]= '~';
|
||||||
strlcpy(elt+HEX_DIGEST_LEN+2,
|
strlcpy(elt+HEX_DIGEST_LEN+2,
|
||||||
hop->extend_info->nickname, MAX_NICKNAME_LEN+1);
|
hop->extend_info->nickname, MAX_NICKNAME_LEN+1);
|
||||||
} else {
|
} else {
|
||||||
elt[0] = '$';
|
elt[0] = '$';
|
||||||
base16_encode(elt+1, HEX_DIGEST_LEN+1,
|
base16_encode(elt+1, HEX_DIGEST_LEN+1, id, DIGEST_LEN);
|
||||||
hop->extend_info->identity_digest, DIGEST_LEN);
|
|
||||||
}
|
}
|
||||||
} else { /* ! verbose_names */
|
} else { /* ! verbose_names */
|
||||||
if ((ri = router_get_by_digest(hop->extend_info->identity_digest)) &&
|
if ((ri = router_get_by_digest(id)) &&
|
||||||
ri->is_named) {
|
ri->is_named) {
|
||||||
elt = tor_strdup(hop->extend_info->nickname);
|
elt = tor_strdup(hop->extend_info->nickname);
|
||||||
} else {
|
} else {
|
||||||
elt = tor_malloc(HEX_DIGEST_LEN+2);
|
elt = tor_malloc(HEX_DIGEST_LEN+2);
|
||||||
elt[0] = '$';
|
elt[0] = '$';
|
||||||
base16_encode(elt+1, HEX_DIGEST_LEN+1,
|
base16_encode(elt+1, HEX_DIGEST_LEN+1, id, DIGEST_LEN);
|
||||||
hop->extend_info->identity_digest, DIGEST_LEN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tor_assert(elt);
|
tor_assert(elt);
|
||||||
|
Loading…
Reference in New Issue
Block a user