diff options
author | Roger Dingledine <arma@torproject.org> | 2007-03-15 03:11:53 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-03-15 03:11:53 +0000 |
commit | 5b8adc7c9be90cb311ef19d88b02af49dda39ec6 (patch) | |
tree | eb6aa39bb9fe545b9b468af1197203fbb15da026 /src | |
parent | 5740071674f88e152ce9dd65530881874d36e037 (diff) | |
download | tor-5b8adc7c9be90cb311ef19d88b02af49dda39ec6.tar.gz tor-5b8adc7c9be90cb311ef19d88b02af49dda39ec6.zip |
Make 'getinfo fingerprint' return a 551 error if we're not a
server, so we match what the control spec claims we do. Reported
by daejees.
svn:r9818
Diffstat (limited to 'src')
-rw-r--r-- | src/or/control.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/or/control.c b/src/or/control.c index 0c245723e1..4784cb9092 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1207,13 +1207,11 @@ getinfo_helper_misc(control_connection_t *conn, const char *question, *answer = directory_dump_request_log(); } else if (!strcmp(question, "fingerprint")) { routerinfo_t *me = router_get_my_routerinfo(); - if (!me) { - *answer = tor_strdup(""); - } else { - *answer = tor_malloc(HEX_DIGEST_LEN+1); - base16_encode(*answer, HEX_DIGEST_LEN+1, me->cache_info.identity_digest, - DIGEST_LEN); - } + if (!me) + return -1; + *answer = tor_malloc(HEX_DIGEST_LEN+1); + base16_encode(*answer, HEX_DIGEST_LEN+1, me->cache_info.identity_digest, + DIGEST_LEN); } return 0; } |