[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9062: some more cleanups and a bugfix on r9052 (tor/trunk/src/or)



Author: arma
Date: 2006-12-10 03:04:50 -0500 (Sun, 10 Dec 2006)
New Revision: 9062

Modified:
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/circuituse.c
   tor/trunk/src/or/connection_edge.c
   tor/trunk/src/or/control.c
   tor/trunk/src/or/hibernate.c
   tor/trunk/src/or/or.h
Log:
some more cleanups and a bugfix on r9052


Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2006-12-10 04:50:33 UTC (rev 9061)
+++ tor/trunk/src/or/circuitbuild.c	2006-12-10 08:04:50 UTC (rev 9062)
@@ -1097,11 +1097,6 @@
   return 0;
 }
 
-/** How many circuits do we want simultaneously in-progress to handle
- * a given stream?
- */
-#define MIN_CIRCUITS_HANDLING_STREAM 2
-
 static int
 ap_stream_wants_exit_attention(connection_t *conn)
 {

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2006-12-10 04:50:33 UTC (rev 9061)
+++ tor/trunk/src/or/circuituse.c	2006-12-10 08:04:50 UTC (rev 9062)
@@ -168,8 +168,6 @@
              purpose == CIRCUIT_PURPOSE_C_REND_JOINED);
 
   for (circ=global_circuitlist;circ;circ = circ->next) {
-    if (!CIRCUIT_IS_ORIGIN(circ))
-      continue;
     if (!circuit_is_acceptable(circ,conn,must_be_open,purpose,
                                need_uptime,need_internal,now))
       continue;
@@ -281,7 +279,8 @@
   for (i = 0; i < smartlist_len(needed_ports); ++i) {
     port = smartlist_get(needed_ports, i);
     tor_assert(*port);
-    if (circuit_stream_is_being_handled(NULL, *port, 2)) {
+    if (circuit_stream_is_being_handled(NULL, *port,
+                                        MIN_CIRCUITS_HANDLING_STREAM)) {
 //      log_debug(LD_CIRC,"Port %d is already being handled; removing.", port);
       smartlist_del(needed_ports, i--);
       tor_free(port);

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2006-12-10 04:50:33 UTC (rev 9061)
+++ tor/trunk/src/or/connection_edge.c	2006-12-10 08:04:50 UTC (rev 9062)
@@ -430,8 +430,8 @@
   } /* end for */
 }
 
-/** Tell any AP streams that are waiting for a new circuit that one is
- * available.
+/** Tell any AP streams that are waiting for a new circuit to try again,
+ * either attaching to an available circ or launching a new one.
  */
 void
 connection_ap_attach_pending(void)
@@ -493,7 +493,7 @@
 
 /** The AP connection <b>conn</b> has just failed while attaching or
  * sending a BEGIN or resolving on <b>circ</b>, but another circuit
- * might work.  Detach the circuit, and either reattach it, launch a
+ * might work. Detach the circuit, and either reattach it, launch a
  * new circuit, tell the controller, or give up as a appropriate.
  *
  * Returns -1 on err, 1 on success, 0 on not-yet-sure.
@@ -1078,7 +1078,7 @@
  * figure it out ourselves.
  *
  * First, parse whether it's a .exit address, remap it, and so on. Then
- * it's for a general circuit, try to attach it to a circuit (or launch
+ * if it's for a general circuit, try to attach it to a circuit (or launch
  * one as needed), else if it's for a rendezvous circuit, fetch a
  * rendezvous descriptor first (or attach/launch a circuit if the
  * rendezvous descriptor is already here and fresh enough).
@@ -1505,9 +1505,10 @@
 }
 
 /** connection_edge_process_inbuf() found a conn in state
- * natd_wait. See if conn->inbuf has the right bytes to proceed.
+ * natd_wait. See if conn-\>inbuf has the right bytes to proceed.
  * See libalias(3) and ProxyEncodeTcpStream() in alias_proxy.c for
  * the encoding form of the original destination.
+ * XXX what is "alias_proxy.c"? -RD
  *
  * If the original destination is complete, send it to
  * connection_ap_handshake_rewrite_and_attach().

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-12-10 04:50:33 UTC (rev 9061)
+++ tor/trunk/src/or/control.c	2006-12-10 08:04:50 UTC (rev 9062)
@@ -1733,7 +1733,7 @@
        "Time when the accounting period starts."),
   ITEM("accounting/interval-end", accounting,
        "Time when the accounting period ends."),
-  ITEM("accounting/interval-warke", accounting,
+  ITEM("accounting/interval-wake", accounting,
        "Time to wake up in this accounting period."),
   /* deprecated */
   ITEM("helper-nodes", entry_guards, NULL),

Modified: tor/trunk/src/or/hibernate.c
===================================================================
--- tor/trunk/src/or/hibernate.c	2006-12-10 04:50:33 UTC (rev 9061)
+++ tor/trunk/src/or/hibernate.c	2006-12-10 08:04:50 UTC (rev 9062)
@@ -530,6 +530,7 @@
   }
 }
 
+/* This rounds 0 up to 1000, but that's actually a feature. */
 #define ROUND_UP(x) (((x) + 0x3ff) & ~0x3ff)
 #define BW_ACCOUNTING_VERSION 1
 /** Save all our bandwidth tracking information to disk. Return 0 on

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-12-10 04:50:33 UTC (rev 9061)
+++ tor/trunk/src/or/or.h	2006-12-10 08:04:50 UTC (rev 9062)
@@ -445,6 +445,10 @@
 #define CIRCUIT_PURPOSE_IS_ORIGIN(p) ((p)>_CIRCUIT_PURPOSE_OR_MAX)
 #define CIRCUIT_IS_ORIGIN(c) (CIRCUIT_PURPOSE_IS_ORIGIN((c)->purpose))
 
+/** How many circuits do we want simultaneously in-progress to handle
+ * a given stream? */
+#define MIN_CIRCUITS_HANDLING_STREAM 2
+
 #define RELAY_COMMAND_BEGIN 1
 #define RELAY_COMMAND_DATA 2
 #define RELAY_COMMAND_END 3