summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2019-12-08 22:20:16 -0600
committerTaylor Yu <catalyst@torproject.org>2019-12-09 09:55:04 -0600
commitbfe38878b28a90fb80d9e6311d28dcabd978b1ba (patch)
treea6fa7a51ae0a1ae2b708669c8478afcadf45cd3d /src
parent69d56625d14ad61db389acd4e0cdde7582f13c56 (diff)
downloadtor-bfe38878b28a90fb80d9e6311d28dcabd978b1ba.tar.gz
tor-bfe38878b28a90fb80d9e6311d28dcabd978b1ba.zip
Rename control_reply_add_1kv
Part of ticket 30984.
Diffstat (limited to 'src')
-rw-r--r--src/feature/control/control_cmd.c6
-rw-r--r--src/feature/control/control_getinfo.c2
-rw-r--r--src/feature/control/control_proto.c6
-rw-r--r--src/feature/control/control_proto.h6
-rw-r--r--src/test/test_controller.c6
5 files changed, 13 insertions, 13 deletions
diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c
index ce7d1ad2cf..cc4375112f 100644
--- a/src/feature/control/control_cmd.c
+++ b/src/feature/control/control_cmd.c
@@ -299,13 +299,13 @@ handle_control_getconf(control_connection_t *conn,
config_line_t *answer = option_get_assignment(options,q);
if (!answer) {
const char *name = option_get_canonical_name(q);
- control_reply_add_1kv(answers, 250, KV_OMIT_VALS, name, "");
+ control_reply_add_one_kv(answers, 250, KV_OMIT_VALS, name, "");
}
while (answer) {
config_line_t *next;
- control_reply_add_1kv(answers, 250, KV_RAW, answer->key,
- answer->value);
+ control_reply_add_one_kv(answers, 250, KV_RAW, answer->key,
+ answer->value);
next = answer->next;
tor_free(answer->key);
tor_free(answer->value);
diff --git a/src/feature/control/control_getinfo.c b/src/feature/control/control_getinfo.c
index 20dc4d082f..cff4a08793 100644
--- a/src/feature/control/control_getinfo.c
+++ b/src/feature/control/control_getinfo.c
@@ -1653,7 +1653,7 @@ handle_control_getinfo(control_connection_t *conn,
"Unrecognized key \"%s\"", q);
}
} else {
- control_reply_add_1kv(answers, 250, KV_RAW, q, ans);
+ control_reply_add_one_kv(answers, 250, KV_RAW, q, ans);
}
} SMARTLIST_FOREACH_END(q);
diff --git a/src/feature/control/control_proto.c b/src/feature/control/control_proto.c
index 4efe735c72..7d04fea6a7 100644
--- a/src/feature/control/control_proto.c
+++ b/src/feature/control/control_proto.c
@@ -335,8 +335,8 @@ control_write_reply_lines(control_connection_t *conn, smartlist_t *lines)
* @param val value
*/
void
-control_reply_add_1kv(smartlist_t *reply, int code, int flags,
- const char *key, const char *val)
+control_reply_add_one_kv(smartlist_t *reply, int code, int flags,
+ const char *key, const char *val)
{
control_reply_line_t *line = tor_malloc_zero(sizeof(*line));
@@ -374,7 +374,7 @@ control_reply_append_kv(smartlist_t *reply, const char *key, const char *val)
void
control_reply_add_str(smartlist_t *reply, int code, const char *s)
{
- control_reply_add_1kv(reply, code, KV_OMIT_KEYS|KV_RAW, "", s);
+ control_reply_add_one_kv(reply, code, KV_OMIT_KEYS|KV_RAW, "", s);
}
/** Format a new reply line
diff --git a/src/feature/control/control_proto.h b/src/feature/control/control_proto.h
index 65c81924fd..cf7c000439 100644
--- a/src/feature/control/control_proto.h
+++ b/src/feature/control/control_proto.h
@@ -29,7 +29,7 @@
* Generally, modules implementing control commands will work with
* smartlists of these structures, using functions like
* control_reply_add_str() for adding a reply line consisting of a
- * single string, or control_reply_add_1kv() and
+ * single string, or control_reply_add_one_kv() and
* control_reply_append_kv() for composing a line containing one or
* more key-value pairs.
*
@@ -97,8 +97,8 @@ void control_write_reply_line(control_connection_t *conn,
const control_reply_line_t *line, bool lastone);
void control_write_reply_lines(control_connection_t *conn, smartlist_t *lines);
-void control_reply_add_1kv(smartlist_t *reply, int code, int flags,
- const char *key, const char *val);
+void control_reply_add_one_kv(smartlist_t *reply, int code, int flags,
+ const char *key, const char *val);
void control_reply_append_kv(smartlist_t *reply, const char *key,
const char *val);
void control_reply_add_str(smartlist_t *reply, int code, const char *s);
diff --git a/src/test/test_controller.c b/src/test/test_controller.c
index eb68e48476..b3023130ae 100644
--- a/src/test/test_controller.c
+++ b/src/test/test_controller.c
@@ -1993,8 +1993,8 @@ test_control_reply(void *arg)
UNMOCK(control_write_reply);
MOCK(control_write_reply, mock_control_write_reply_list);
reply_strs = smartlist_new();
- control_reply_add_1kv(lines, 250, 0, "A", "B");
- control_reply_add_1kv(lines, 250, 0, "C", "D");
+ control_reply_add_one_kv(lines, 250, 0, "A", "B");
+ control_reply_add_one_kv(lines, 250, 0, "C", "D");
control_write_reply_lines(NULL, lines);
tt_int_op(smartlist_len(reply_strs), OP_EQ, 2);
tt_str_op((char *)smartlist_get(reply_strs, 0), OP_EQ, "250-A=B");
@@ -2004,7 +2004,7 @@ test_control_reply(void *arg)
SMARTLIST_FOREACH(reply_strs, char *, p, tor_free(p));
smartlist_clear(reply_strs);
control_reply_add_printf(lines, 250, "PROTOCOLINFO %d", 1);
- control_reply_add_1kv(lines, 250, KV_OMIT_VALS|KV_RAW, "AUTH", "");
+ control_reply_add_one_kv(lines, 250, KV_OMIT_VALS|KV_RAW, "AUTH", "");
control_reply_append_kv(lines, "METHODS", "COOKIE");
control_reply_append_kv(lines, "COOKIEFILE", escaped("/tmp/cookie"));
control_reply_add_done(lines);