mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-23 14:40:51 +01:00
r9160@totoro: nickm | 2006-10-24 17:38:07 -0400
More dirserver oops: actually set the digest for a given name in the case when the name is not yet recognized. svn:r8820
This commit is contained in:
parent
ba1b04c736
commit
a5bf6df14a
1 changed files with 7 additions and 8 deletions
|
@ -113,13 +113,11 @@ add_fingerprint_to_dir(const char *nickname, const char *fp,
|
|||
|
||||
if (nickname[0] != '!') {
|
||||
char *old_fp = strmap_get_lc(list->fp_by_name, nickname);
|
||||
if (old_fp) {
|
||||
if (!strcasecmp(fingerprint, old_fp)) {
|
||||
tor_free(fingerprint);
|
||||
} else {
|
||||
tor_free(old_fp);
|
||||
strmap_set_lc(list->fp_by_name, nickname, fingerprint);
|
||||
}
|
||||
if (old_fp && !strcasecmp(fingerprint, old_fp)) {
|
||||
tor_free(fingerprint);
|
||||
} else {
|
||||
tor_free(old_fp);
|
||||
strmap_set_lc(list->fp_by_name, nickname, fingerprint);
|
||||
}
|
||||
status->status |= FP_NAMED;
|
||||
strlcpy(status->nickname, nickname, sizeof(status->nickname));
|
||||
|
@ -320,7 +318,8 @@ dirserv_get_status_impl(const char *id_digest, const char *nickname,
|
|||
base16_encode(fp, sizeof(fp), id_digest, DIGEST_LEN);
|
||||
|
||||
if (should_log)
|
||||
log_debug(LD_DIRSERV, "%d fingerprints known.",
|
||||
log_debug(LD_DIRSERV, "%d fingerprints, %d digests known.",
|
||||
strmap_size(fingerprint_list->fp_by_name),
|
||||
digestmap_size(fingerprint_list->status_by_digest));
|
||||
|
||||
if ((fp_by_name =
|
||||
|
|
Loading…
Add table
Reference in a new issue