diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-10-24 21:38:31 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-10-24 21:38:31 +0000 |
commit | a5bf6df14a7e8c5536a80d5ff914d2a42da9030d (patch) | |
tree | 630d6caa8f92e2cc964ba94c1a5bed8ca79b2540 | |
parent | ba1b04c736b7bc0768e337aa4d8015f086a191ce (diff) | |
download | tor-a5bf6df14a7e8c5536a80d5ff914d2a42da9030d.tar.gz tor-a5bf6df14a7e8c5536a80d5ff914d2a42da9030d.zip |
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
-rw-r--r-- | src/or/dirserv.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index f4b5fdd333..543712dcc6 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -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 = |