[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r9823: change my mind -- correct the spec to match the code's behav (in tor/trunk: . doc/spec src/or)
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] r9823: change my mind -- correct the spec to match the code's behav (in tor/trunk: . doc/spec src/or)
- From: arma@xxxxxxxx
- Date: Thu, 15 Mar 2007 02:25:03 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Thu, 15 Mar 2007 02:25:12 -0400
- Reply-to: or-talk@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Author: arma
Date: 2007-03-15 02:25:00 -0400 (Thu, 15 Mar 2007)
New Revision: 9823
Modified:
tor/trunk/ChangeLog
tor/trunk/doc/spec/control-spec.txt
tor/trunk/src/or/connection_edge.c
tor/trunk/src/or/control.c
Log:
change my mind -- correct the spec to match the code's
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.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2007-03-15 06:10:58 UTC (rev 9822)
+++ tor/trunk/ChangeLog 2007-03-15 06:25:00 UTC (rev 9823)
@@ -40,7 +40,8 @@
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
Modified: tor/trunk/doc/spec/control-spec.txt
===================================================================
--- tor/trunk/doc/spec/control-spec.txt 2007-03-15 06:10:58 UTC (rev 9822)
+++ tor/trunk/doc/spec/control-spec.txt 2007-03-15 06:25:00 UTC (rev 9823)
@@ -378,8 +378,8 @@
"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
Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c 2007-03-15 06:10:58 UTC (rev 9822)
+++ tor/trunk/src/or/connection_edge.c 2007-03-15 06:25:00 UTC (rev 9823)
@@ -1142,7 +1142,7 @@
/** 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 @@
} 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);
}
}
Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c 2007-03-15 06:10:58 UTC (rev 9822)
+++ tor/trunk/src/or/control.c 2007-03-15 06:25:00 UTC (rev 9823)
@@ -1465,7 +1465,7 @@
}
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);
}