diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 6 | ||||
-rw-r--r-- | src/or/connection.c | 7 | ||||
-rwxr-xr-x | src/test/test_cmdline_args.py | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c index 14e8f9ab37..95cede0153 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1129,9 +1129,6 @@ options_act_reversible(const or_options_t *old_options, char **msg) /* No need to roll back, since you can't change the value. */ } - /* Write control ports to disk as appropriate */ - control_ports_write_to_file(); - if (directory_caches_v2_dir_info(options)) { char *fn = NULL; tor_asprintf(&fn, "%s"PATH_SEPARATOR"cached-status", @@ -1330,6 +1327,9 @@ options_act(const or_options_t *old_options) } } + /* Write control ports to disk as appropriate */ + control_ports_write_to_file(); + if (running_tor && !have_lockfile()) { if (try_locking(options, 1) < 0) return -1; diff --git a/src/or/connection.c b/src/or/connection.c index 8cf23ab0ef..648fa32703 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -334,7 +334,6 @@ control_connection_new(int socket_family) tor_malloc_zero(sizeof(control_connection_t)); connection_init(time(NULL), TO_CONN(control_conn), CONN_TYPE_CONTROL, socket_family); - log_notice(LD_CONTROL, "New control connection opened."); return control_conn; } @@ -1377,11 +1376,17 @@ connection_handle_listener_read(connection_t *conn, int new_type) TO_ENTRY_CONN(newconn)->socks_request->socks_prefer_no_auth = TO_LISTENER_CONN(conn)->socks_prefer_no_auth; } + if (new_type == CONN_TYPE_CONTROL) { + log_notice(LD_CONTROL, "New control connection opened from %s.", + fmt_and_decorate_addr(&addr)); + } } else if (conn->socket_family == AF_UNIX) { /* For now only control ports can be Unix domain sockets * and listeners at the same time */ tor_assert(conn->type == CONN_TYPE_CONTROL_LISTENER); + tor_assert(new_type == CONN_TYPE_CONTROL); + log_notice(LD_CONTROL, "New control connection opened."); newconn = connection_new(new_type, conn->socket_family); newconn->s = news; diff --git a/src/test/test_cmdline_args.py b/src/test/test_cmdline_args.py index 1b0963f6b9..2213bb5702 100755 --- a/src/test/test_cmdline_args.py +++ b/src/test/test_cmdline_args.py @@ -163,9 +163,9 @@ class CmdlineTests(unittest.TestCase): out_fl = lines(out_fl) self.assert_(len(out_fl) > 100) - self.assertIn("SocksPort 9999", out_fl) - self.assertIn("SafeLogging 0", out_fl) - self.assertIn("ClientOnly 0", out_fl) + self.assert_("SocksPort 9999" in out_fl) + self.assert_("SafeLogging 0" in out_fl) + self.assert_("ClientOnly 0" in out_fl) self.assert_(out_verif.endswith("Configuration was valid\n")) |