diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-10-25 11:52:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-10-25 11:52:45 -0400 |
commit | 4b8282e50cce1c63afbf7f501de1312a6f283387 (patch) | |
tree | 04432688c43660e73dd531dafc43b80a5f4e47f9 /src/or | |
parent | 338bcad9e4b287664e6be94cbeb332e41e03a3c0 (diff) | |
download | tor-4b8282e50cce1c63afbf7f501de1312a6f283387.tar tor-4b8282e50cce1c63afbf7f501de1312a6f283387.tar.gz |
Log the origin address of controller connections
Resolves 9698; patch from "sigpipe".
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/connection.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 8cf23ab0e..648fa3270 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; |