summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-04-02 22:13:34 +0000
committerRoger Dingledine <arma@torproject.org>2006-04-02 22:13:34 +0000
commite84cd412d45d3ceda0680c8644208cccaef21355 (patch)
treeb5780d7722b81b7993da58a2f33d875dcb5ff0f4
parent403be1a39654817ae4e2365b0b84daa1df041266 (diff)
downloadtor-e84cd412d45d3ceda0680c8644208cccaef21355.tar.gz
tor-e84cd412d45d3ceda0680c8644208cccaef21355.zip
if you give mapaddress no args at all, it should answer
something more than \r\n. svn:r6293
-rw-r--r--src/or/control.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c
index f2beee04ab..f029382853 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1247,16 +1247,22 @@ handle_control_mapaddress(connection_t *conn, uint32_t len, const char *body)
if (v0) {
r = smartlist_join_strings(reply, "\n", 1, &sz);
send_control_done2(conn,r,sz);
+ tor_free(r);
} else {
- if (smartlist_len(reply))
+ if (smartlist_len(reply)) {
((char*)smartlist_get(reply,smartlist_len(reply)-1))[3] = ' ';
- r = smartlist_join_strings(reply, "\r\n", 1, &sz);
- connection_write_to_buf(r, sz, conn);
+ r = smartlist_join_strings(reply, "\r\n", 1, &sz);
+ connection_write_to_buf(r, sz, conn);
+ tor_free(r);
+ } else {
+ const char *response =
+ "512 syntax error: not enough arguments to mapaddress.";
+ connection_write_to_buf(response, strlen(response), conn);
+ }
}
SMARTLIST_FOREACH(reply, char *, cp, tor_free(cp));
smartlist_free(reply);
- tor_free(r);
return 0;
}