aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-08 12:10:06 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-24 09:18:56 -0500
commit818b44cc7c22696a3206229e4e15eeb9f130e2c0 (patch)
treebf77c5a4144eaeef0a3be86a7d6f753e1dc30266 /src/or/control.c
parentfae4d3d9250ecc6cd34a70b642009bf8923a51f4 (diff)
downloadtor-818b44cc7c22696a3206229e4e15eeb9f130e2c0.tar.gz
tor-818b44cc7c22696a3206229e4e15eeb9f130e2c0.zip
Repair the (deprecated, ugly) DROPGUARDS controller function.
This actually is much easier to write now that guard_selection_t is first-class.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 364d75c976..857b7325ae 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4064,17 +4064,20 @@ handle_control_dropguards(control_connection_t *conn,
smartlist_split_string(args, body, " ",
SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
-#ifdef ENABLE_LEGACY_GUARD_ALGORITHM
+ static int have_warned = 0;
+ if (! have_warned) {
+ log_warn(LD_CONTROL, "DROPGUARDS is dangerous; make sure you understand "
+ "the risks before using it. It may be removed in a future "
+ "version of Tor.");
+ have_warned = 1;
+ }
+
if (smartlist_len(args)) {
connection_printf_to_buf(conn, "512 Too many arguments to DROPGUARDS\r\n");
} else {
remove_all_entry_guards();
send_control_done(conn);
}
-#else
- // XXXX
- connection_printf_to_buf(conn, "512 not supported\r\n");
-#endif
SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
smartlist_free(args);