diff options
author | Roger Dingledine <arma@torproject.org> | 2006-03-26 06:51:26 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-03-26 06:51:26 +0000 |
commit | b899b9592a89281a05d5b4b7842de67d106303ab (patch) | |
tree | 13d94062519b87a12d082a32b702f6cd6509664b /src/or/control.c | |
parent | 0543900fbf8b69b6b7c0e5640cd2bfb5f6653d96 (diff) | |
download | tor-b899b9592a89281a05d5b4b7842de67d106303ab.tar.gz tor-b899b9592a89281a05d5b4b7842de67d106303ab.zip |
When the controller's *setconf commands fail, collect an error message
in a string and hand it back. This starts to resolve bug 275.
svn:r6241
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c index cc09f9bec2..eab6b53511 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -663,6 +663,7 @@ control_setconf_helper(connection_t *conn, uint32_t len, char *body, int r; config_line_t *lines=NULL; char *start = body; + char *errstring = NULL; int v0 = STATE_IS_V0(conn->state); if (!v0) { @@ -717,11 +718,13 @@ control_setconf_helper(connection_t *conn, uint32_t len, char *body, } } - if ((r=options_trial_assign(lines, use_defaults, clear_first)) < 0) { + if ((r=options_trial_assign(lines, use_defaults, + clear_first, &errstring)) < 0) { int v0_err; const char *msg; log_warn(LD_CONTROL, - "Controller gave us config lines that didn't validate."); + "Controller gave us config lines that didn't validate: %s.", + errstring); switch (r) { case -1: v0_err = ERR_UNRECOGNIZED_CONFIG_KEY; @@ -744,9 +747,10 @@ control_setconf_helper(connection_t *conn, uint32_t len, char *body, if (v0) { send_control0_error(conn, v0_err, msg); } else { - connection_printf_to_buf(conn, "%s\r\n", msg); + connection_printf_to_buf(conn, "%s: %s\r\n", msg, errstring); } config_free_lines(lines); + tor_free(errstring); return 0; } config_free_lines(lines); |