actually, don't fix it that far. we should still do some

error checking.


svn:r6576
This commit is contained in:
Roger Dingledine 2006-06-09 09:07:59 +00:00
parent 0071d67efd
commit 6531a31aad

View File

@ -1817,12 +1817,15 @@ add_an_entry_guard(routerinfo_t *chosen)
routerinfo_t *router;
entry_guard_t *entry;
if (chosen)
if (chosen) {
router = chosen;
else
if (is_an_entry_guard(router->cache_info.identity_digest))
return NULL;
} else {
router = choose_good_entry_server(CIRCUIT_PURPOSE_C_GENERAL, NULL);
if (!router)
return NULL;
if (!router)
return NULL;
}
entry = tor_malloc_zero(sizeof(entry_guard_t));
log_info(LD_CIRC, "Chose '%s' as new entry guard.", router->nickname);
strlcpy(entry->nickname, router->nickname, sizeof(entry->nickname));