[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9818: Make 'getinfo fingerprint' return a 551 error if we're not a (in tor/trunk: . src/or)



Author: arma
Date: 2007-03-14 23:11:53 -0400 (Wed, 14 Mar 2007)
New Revision: 9818

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/control.c
Log:
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.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-03-14 23:50:41 UTC (rev 9817)
+++ tor/trunk/ChangeLog	2007-03-15 03:11:53 UTC (rev 9818)
@@ -34,6 +34,9 @@
 
   o Minor bugfixes:
     - Stop allowing hibernating servers to be "stable" or "fast".
+    - 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.
 
 
 Changes in version 0.1.2.10-rc - 2007-03-07

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2007-03-14 23:50:41 UTC (rev 9817)
+++ tor/trunk/src/or/control.c	2007-03-15 03:11:53 UTC (rev 9818)
@@ -1207,13 +1207,11 @@
     *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;
 }