mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Also set event_mask=0 in connection_free_all, and dont send events to marked control conns (for good measure)
svn:r4729
This commit is contained in:
parent
5c4da9dec6
commit
4e735da5da
@ -276,6 +276,13 @@ connection_free_all(void)
|
||||
connection_t **carray;
|
||||
|
||||
get_connection_array(&carray,&n);
|
||||
|
||||
/* We don't want to log any messages to controllers. */
|
||||
for (i=0;i<n;i++)
|
||||
if (carray[i]->type == CONN_TYPE_CONTROL)
|
||||
carray[i]->event_mask = 0;
|
||||
control_update_global_event_mask();
|
||||
|
||||
for (i=0;i<n;i++)
|
||||
_connection_free(carray[i]);
|
||||
|
||||
|
@ -523,6 +523,7 @@ send_control0_event(uint16_t event, uint32_t len, const char *body)
|
||||
get_connection_array(&conns, &n_conns);
|
||||
for (i = 0; i < n_conns; ++i) {
|
||||
if (conns[i]->type == CONN_TYPE_CONTROL &&
|
||||
!conns[i]->marked_for_close &&
|
||||
conns[i]->state == CONTROL_CONN_STATE_OPEN_V0 &&
|
||||
conns[i]->event_mask & (1<<event)) {
|
||||
send_control0_message(conns[i], CONTROL0_CMD_EVENT, buflen, buf);
|
||||
@ -560,6 +561,7 @@ send_control1_event(uint16_t event, const char *format, ...)
|
||||
get_connection_array(&conns, &n_conns);
|
||||
for (i = 0; i < n_conns; ++i) {
|
||||
if (conns[i]->type == CONN_TYPE_CONTROL &&
|
||||
!conns[i]->marked_for_close &&
|
||||
conns[i]->state == CONTROL_CONN_STATE_OPEN_V1 &&
|
||||
conns[i]->event_mask & (1<<event)) {
|
||||
connection_write_to_buf(buf, len, conns[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user