diff --git a/src/or/connection.c b/src/or/connection.c index 855fc9e399..f68fd3362d 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -253,6 +253,10 @@ connection_free(connection_t *conn) if (conn->state == OR_CONN_STATE_OPEN) directory_set_dirty(); } + if (conn->type == CONN_TYPE_CONTROL) { + conn->event_mask = 0; + control_update_global_event_mask(); + } connection_unregister(conn); _connection_free(conn); } diff --git a/src/or/control.c b/src/or/control.c index b9032742b2..ba65c4ebee 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -127,7 +127,6 @@ static char authentication_cookie[AUTHENTICATION_COOKIE_LEN]; static void connection_printf_to_buf(connection_t *conn, const char *format, ...) CHECK_PRINTF(2,3); -static void update_global_event_mask(void); static void send_control0_message(connection_t *conn, uint16_t type, uint32_t len, const char *body); static void send_control_done(connection_t *conn); @@ -204,8 +203,8 @@ log_severity_to_event(int severity) /** Set global_event_mask to the bitwise OR of each live control * connection's event_mask field. */ -static void -update_global_event_mask(void) +void +control_update_global_event_mask(void) { connection_t **conns; int n_conns, i; @@ -847,7 +846,7 @@ handle_control_setevents(connection_t *conn, uint32_t len, const char *body) } conn->event_mask = event_mask; - update_global_event_mask(); + control_update_global_event_mask(); send_control_done(conn); return 0; } diff --git a/src/or/or.h b/src/or/or.h index da6d261017..30f0e0a403 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1536,6 +1536,7 @@ typedef enum or_conn_status_event_t { OR_CONN_EVENT_CLOSED = 3, } or_conn_status_event_t; +void control_update_global_event_mask(void); void control_adjust_event_log_severity(void); void disable_control_logging(void); void enable_control_logging(void);