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

[or-cvs] Clean up some comments; remove some dead code



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv7847/src/or

Modified Files:
	circuitbuild.c circuitlist.c circuituse.c connection_edge.c 
Log Message:
Clean up some comments; remove some dead code

Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -d -r1.165 -r1.166
--- circuitbuild.c	3 Dec 2005 02:12:36 -0000	1.165
+++ circuitbuild.c	3 Dec 2005 16:32:29 -0000	1.166
@@ -411,8 +411,9 @@
         continue;
       }
       debug(LD_CIRC,"Found circ %d, sending create cell.", circ->n_circ_id);
-      /* circuit_deliver_create_cell will set n_circ_id and add us to the
-       * index. */
+      /* circuit_deliver_create_cell will set n_circ_id and add us to
+       * orconn_circuid_circuit_map, so we don't need to call
+       * set_circid_orconn here. */
       circ->n_conn = or_conn;
       memcpy(circ->n_conn_id_digest, or_conn->identity_digest, DIGEST_LEN);
       if (CIRCUIT_IS_ORIGIN(circ)) {

Index: circuitlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuitlist.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- circuitlist.c	3 Dec 2005 03:36:32 -0000	1.79
+++ circuitlist.c	3 Dec 2005 16:32:29 -0000	1.80
@@ -132,8 +132,8 @@
   ++conn->n_circuits;
 }
 
-/** Add <b>circ</b> to the list of circuits waiting for us to connect to
- * an OR. */
+/** Change the state of <b>circ</b> to <b>state</b>, adding it to or removing
+ * it from lists as appropriate. */
 void
 circuit_set_state(circuit_t *circ, int state)
 {
@@ -142,9 +142,8 @@
     return;
   if (circ->state == CIRCUIT_STATE_OR_WAIT) {
     /* remove from waiting-circuit list. */
-    if (!circuits_pending_or_conns)
-      circuits_pending_or_conns = smartlist_create();
-    smartlist_remove(circuits_pending_or_conns, circ);
+    if (circuits_pending_or_conns)
+      smartlist_remove(circuits_pending_or_conns, circ);
   }
   if (state == CIRCUIT_STATE_OR_WAIT) {
     /* add to waiting-circuit list. */
@@ -155,13 +154,6 @@
   circ->state = state;
 }
 
-/** Remove <b>circ</b> from the list of circuits waiting for us to connect to
- * an OR. */
-void
-circuit_clear_state_orwait(circuit_t *circ)
-{
-}
-
 /** Add <b>circ</b> to the global list of circuits. This is called only from
  * within circuit_new.
  */

Index: circuituse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- circuituse.c	3 Dec 2005 05:29:05 -0000	1.94
+++ circuituse.c	3 Dec 2005 16:32:29 -0000	1.95
@@ -230,7 +230,8 @@
         case CIRCUIT_PURPOSE_REND_ESTABLISHED:
           /* OR-side. We can't actually reach this point because of the
            * IS_ORIGIN test above. */
-          continue;
+          continue; /* yes, continue inside a switch refers to the nearest
+                     * enclosing loop. C is smart. */
         case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
         case CIRCUIT_PURPOSE_C_INTRODUCING:
         case CIRCUIT_PURPOSE_S_ESTABLISH_INTRO:

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.365
retrieving revision 1.366
diff -u -d -r1.365 -r1.366
--- connection_edge.c	3 Dec 2005 02:21:30 -0000	1.365
+++ connection_edge.c	3 Dec 2005 16:32:29 -0000	1.366
@@ -424,7 +424,7 @@
 }
 
 /** A client-side struct to remember requests to rewrite addresses
- * to new addresses. These structs are stored the hash table
+ * to new addresses. These structs are stored in the hash table
  * "addressmap" below.
  *
  * There are 5 ways to set an address mapping: