summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-12-13 19:21:06 -0500
committerRoger Dingledine <arma@torproject.org>2009-12-13 19:21:06 -0500
commitf7d99b62a3357f71e653bd5c39fa083336d82a8e (patch)
tree75368c0f93cc3dec8657cf1527cc1341d3c46bc7 /src/or/control.c
parentd086c9a7f73ce5b9b7cf4add07fa7d071b829081 (diff)
downloadtor-f7d99b62a3357f71e653bd5c39fa083336d82a8e.tar.gz
tor-f7d99b62a3357f71e653bd5c39fa083336d82a8e.zip
New controller command "getinfo config-text"
It returns the contents that Tor would write if you send it a SAVECONF command, so the controller can write the file to disk itself.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 3674b0f35a..2152e18605 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -114,8 +114,6 @@ static int handle_control_setevents(control_connection_t *conn, uint32_t len,
static int handle_control_authenticate(control_connection_t *conn,
uint32_t len,
const char *body);
-static int handle_control_saveconf(control_connection_t *conn, uint32_t len,
- const char *body);
static int handle_control_signal(control_connection_t *conn, uint32_t len,
const char *body);
static int handle_control_mapaddress(control_connection_t *conn, uint32_t len,
@@ -1301,6 +1299,8 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
*answer = tor_strdup(get_version());
} else if (!strcmp(question, "config-file")) {
*answer = tor_strdup(get_torrc_fname());
+ } else if (!strcmp(question, "config-text")) {
+ *answer = options_dump(get_options(), 1);
} else if (!strcmp(question, "info/names")) {
*answer = list_getinfo_options();
} else if (!strcmp(question, "events/names")) {
@@ -1802,6 +1802,8 @@ typedef struct getinfo_item_t {
static const getinfo_item_t getinfo_items[] = {
ITEM("version", misc, "The current version of Tor."),
ITEM("config-file", misc, "Current location of the \"torrc\" file."),
+ ITEM("config-text", misc,
+ "Return the string that would be written by a saveconf command."),
ITEM("accounting/bytes", accounting,
"Number of bytes read/written so far in the accounting interval."),
ITEM("accounting/bytes-left", accounting,