mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
when deciding if a port is handled and the port demands uptime, don't
consider it handled if there's a circ that fits but isn't high-uptime. svn:r3349
This commit is contained in:
@@ -284,6 +284,8 @@ int circuit_stream_is_being_handled(connection_t *conn, uint16_t port, int min)
|
||||
routerinfo_t *exitrouter;
|
||||
int num=0;
|
||||
time_t now = time(NULL);
|
||||
int need_uptime = smartlist_string_num_isin(get_options()->LongLivedPorts,
|
||||
conn ? conn->socks_request->port : port);
|
||||
|
||||
for (circ=global_circuitlist;circ;circ = circ->next) {
|
||||
if (CIRCUIT_IS_ORIGIN(circ) &&
|
||||
@@ -293,6 +295,7 @@ int circuit_stream_is_being_handled(connection_t *conn, uint16_t port, int min)
|
||||
circ->timestamp_dirty + get_options()->NewCircuitPeriod < now)) {
|
||||
exitrouter = router_get_by_digest(circ->build_state->chosen_exit_digest);
|
||||
if (exitrouter &&
|
||||
(!need_uptime || circ->build_state->need_uptime) &&
|
||||
((conn && connection_ap_can_use_exit(conn, exitrouter)) ||
|
||||
(!conn &&
|
||||
router_compare_addr_to_addr_policy(0, port, exitrouter->exit_policy) !=
|
||||
|
||||
Reference in New Issue
Block a user