[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] when deciding if a port is handled and the port demands upt...
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] when deciding if a port is handled and the port demands upt...
- From: arma@xxxxxxxx (Roger Dingledine)
- Date: Thu, 13 Jan 2005 02:23:22 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Thu, 13 Jan 2005 02:23:48 -0500
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or
Modified Files:
	circuituse.c 
Log Message:
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.
Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- circuituse.c	12 Jan 2005 04:58:23 -0000	1.40
+++ circuituse.c	13 Jan 2005 07:23:19 -0000	1.41
@@ -284,6 +284,8 @@
   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 @@
          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) !=