mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Code simplifications for AP_CONN_STATE_CONTROLLER_WAIT
This commit is contained in:
parent
60f699c859
commit
837e0c4dc9
@ -1511,7 +1511,7 @@ connection_entry_set_controller_wait(entry_connection_t *conn)
|
||||
{
|
||||
CONNECTION_AP_EXPECT_NONPENDING(conn);
|
||||
ENTRY_TO_CONN(conn)->state = AP_CONN_STATE_CONTROLLER_WAIT;
|
||||
control_event_enter_controller_wait();
|
||||
control_event_stream_status(conn, STREAM_EVENT_CONTROLLER_WAIT, 0);
|
||||
}
|
||||
|
||||
/** The AP connection <b>conn</b> has just failed while attaching or
|
||||
|
@ -819,6 +819,7 @@ control_event_stream_status(entry_connection_t *conn, stream_status_event_t tp,
|
||||
case STREAM_EVENT_NEW_RESOLVE: status = "NEWRESOLVE"; break;
|
||||
case STREAM_EVENT_FAILED_RETRIABLE: status = "DETACHED"; break;
|
||||
case STREAM_EVENT_REMAP: status = "REMAP"; break;
|
||||
case STREAM_EVENT_CONTROLLER_WAIT: status = "CONTROLLER_WAIT"; break;
|
||||
default:
|
||||
log_warn(LD_BUG, "Unrecognized status code %d", (int)tp);
|
||||
return 0;
|
||||
@ -2364,15 +2365,6 @@ control_events_free_all(void)
|
||||
disable_log_messages = 0;
|
||||
}
|
||||
|
||||
/** Our own router descriptor has changed; tell any controllers that care.
|
||||
*/
|
||||
int
|
||||
control_event_enter_controller_wait(void)
|
||||
{
|
||||
send_control_event(EVENT_CONTROLLER_WAIT, "650 CONTROLLER_WAIT\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef TOR_UNIT_TESTS
|
||||
/* For testing: change the value of global_event_mask */
|
||||
void
|
||||
|
@ -36,7 +36,8 @@ typedef enum stream_status_event_t {
|
||||
STREAM_EVENT_NEW = 5,
|
||||
STREAM_EVENT_NEW_RESOLVE = 6,
|
||||
STREAM_EVENT_FAILED_RETRIABLE = 7,
|
||||
STREAM_EVENT_REMAP = 8
|
||||
STREAM_EVENT_REMAP = 8,
|
||||
STREAM_EVENT_CONTROLLER_WAIT = 9
|
||||
} stream_status_event_t;
|
||||
|
||||
/** Used to indicate the type of a buildtime event */
|
||||
|
Loading…
Reference in New Issue
Block a user