From: Roger Dingledine Date: Thu, 13 Jan 2005 07:23:19 +0000 (+0000) Subject: when deciding if a port is handled and the port demands uptime, don't X-Git-Tag: tor-0.1.0.1-rc~471 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49fe4cba7413ce41e8199ae60a8b19624151b14d;p=thirdparty%2Ftor.git 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 --- diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 783fc20ad4..89d4a58477 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -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) !=