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

[or-cvs] r8486: backport r8355: fix encoding in "getinfo addr-mappings" resp (in tor/branches/tor-0_1_1-patches: . src/or)



Author: arma
Date: 2006-09-24 17:21:40 -0400 (Sun, 24 Sep 2006)
New Revision: 8486

Modified:
   tor/branches/tor-0_1_1-patches/ChangeLog
   tor/branches/tor-0_1_1-patches/src/or/control.c
Log:
backport r8355:
fix encoding in "getinfo addr-mappings" response.
fix error code when "getinfo dir/status/" fails.


Modified: tor/branches/tor-0_1_1-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_1-patches/ChangeLog	2006-09-24 20:54:59 UTC (rev 8485)
+++ tor/branches/tor-0_1_1-patches/ChangeLog	2006-09-24 21:21:40 UTC (rev 8486)
@@ -11,6 +11,8 @@
     - Allow Tor to start when RunAsDaemon is set but no logs are set.
     - Don't crash when the controller receives a third argument to an
       "extendcircuit" request.
+    - Controller protocol fixes: fix encoding in "getinfo addr-mappings"
+      response; fix error code when "getinfo dir/status/" fails.
     - Fix configure.in to not produce broken configure files with
       more recent versions of autoconf. Thanks to Clint for his auto*
       voodoo.
@@ -20,6 +22,7 @@
     - Warn when using libevent 1.1a or earlier with win32 or kqueue
       methods: these are known to be buggy.
 
+
 Changes in version 0.1.1.23 - 2006-07-30
   o Major bugfixes:
     - Fast Tor servers, especially exit nodes, were triggering asserts

Modified: tor/branches/tor-0_1_1-patches/src/or/control.c
===================================================================
--- tor/branches/tor-0_1_1-patches/src/or/control.c	2006-09-24 20:54:59 UTC (rev 8485)
+++ tor/branches/tor-0_1_1-patches/src/or/control.c	2006-09-24 21:21:40 UTC (rev 8486)
@@ -1482,7 +1482,7 @@
     }
     mappings = smartlist_create();
     addressmap_get_mappings(mappings, min_e, max_e);
-    *answer = smartlist_join_strings(mappings, "\n", 0, NULL);
+    *answer = smartlist_join_strings(mappings, "\r\n", 0, NULL);
     SMARTLIST_FOREACH(mappings, char *, cp, tor_free(cp));
     smartlist_free(mappings);
   } else if (!strcmp(question, "dir-usage")) {
@@ -1514,7 +1514,7 @@
     char *cp;
     if (!get_options()->DirPort) {
       log_warn(LD_CONTROL, "getinfo dir/status/ requires an open dirport.");
-      return 0;
+      return -1;
     }
     status_list = smartlist_create();
     dirserv_get_networkstatus_v2(status_list,