]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
when deciding if a port is handled and the port demands uptime, don't
authorRoger Dingledine <arma@torproject.org>
Thu, 13 Jan 2005 07:23:19 +0000 (07:23 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 13 Jan 2005 07:23:19 +0000 (07:23 +0000)
consider it handled if there's a circ that fits but isn't high-uptime.

svn:r3349

src/or/circuituse.c

index 783fc20ad4d4b93b89001381d6dc906894924319..89d4a584779fb4ae345b18c889808ef6a1320624 100644 (file)
@@ -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) !=