]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
change my mind -- correct the spec to match the code's
authorRoger Dingledine <arma@torproject.org>
Thu, 15 Mar 2007 06:25:00 +0000 (06:25 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 15 Mar 2007 06:25:00 +0000 (06:25 +0000)
behavior for getinfo addr-mappings/*. this is because
the code and spec have been mismatched since at least
0.1.1.x, so i would be surprised if nobody at all is
relying on the current behavior.

backport candidate.
backbackport candidate.

svn:r9823

ChangeLog
doc/spec/control-spec.txt
src/or/connection_edge.c
src/or/control.c

index cd6b48734ee6cafb58354a2e699cd04e07dea5be..22d3fae8d7ac88531961cdcc0749303fb97cdc74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,7 +40,8 @@ Changes in version 0.2.0.1-alpha - 2007-??-??
       server, so we match what the control spec claims we do.
     - Fix a typo in an error message when extendcircuit fails that
       caused us to not follow the \r\n-based delimiter protocol.
-    - Make the response to 'getinfo addr-mappings/*' follow the spec.
+    - Correct the control spec to match how the code actually responds
+      to 'getinfo addr-mappings/*'.
 
 
 Changes in version 0.1.2.10-rc - 2007-03-07
index 3bf36b4d22cc459e8fe1e4c857425381cb68782c..3cae676d9aee07fc81e170dc98c144280ec983a4 100644 (file)
@@ -378,8 +378,8 @@ $Id$
     "addr-mappings/all"
     "addr-mappings/config"
     "addr-mappings/cache"
-    "addr-mappings/control" -- a space-separated list of address
-      mappings, each in the form of "from-address=to-address".
+    "addr-mappings/control" -- a \r\n-separated list of address
+      mappings, each in the form of "from-address to-address".
       The 'config' key returns those address mappings set in the
       configuration; the 'cache' key returns the mappings in the
       client-side DNS cache; the 'control' key returns the mappings set
index c5c150c5f759af92cc037a903438e71e417e172f..beb1caeea6b2b1c54848a7722e23f805d6b9cbbd 100644 (file)
@@ -1142,7 +1142,7 @@ address_is_invalid_destination(const char *address, int client)
 
 /** Iterate over all address mappings which have expiry times between
  * min_expires and max_expires, inclusive.  If sl is provided, add an
- * "old-addr=new-addr" string to sl for each mapping.  If sl is NULL,
+ * "old-addr new-addr" string to sl for each mapping.  If sl is NULL,
  * remove the mappings.
  */
 void
@@ -1168,7 +1168,7 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires,
        } else if (val->new_address) {
          size_t len = strlen(key)+strlen(val->new_address)+2;
          char *line = tor_malloc(len);
-         tor_snprintf(line, len, "%s=%s", key, val->new_address);
+         tor_snprintf(line, len, "%s %s", key, val->new_address);
          smartlist_add(sl, line);
        }
      }
index 83c94cb6d3a320e5389dda3700557af5d3cfefb1..8e3a2db601a79d0e4872e12aad9026d57ce685ef 100644 (file)
@@ -1465,7 +1465,7 @@ getinfo_helper_events(control_connection_t *control_conn,
     }
     mappings = smartlist_create();
     addressmap_get_mappings(mappings, min_e, max_e);
-    *answer = smartlist_join_strings(mappings, " ", 0, NULL);
+    *answer = smartlist_join_strings(mappings, "\r\n", 0, NULL);
     SMARTLIST_FOREACH(mappings, char *, cp, tor_free(cp));
     smartlist_free(mappings);
   }