aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-12-03 16:32:29 +0000
committerNick Mathewson <nickm@torproject.org>2005-12-03 16:32:29 +0000
commit1b0134dda8d877f8917f86cf8d3b42fa41ffb625 (patch)
tree18c1e2aecb8bb3f029af2e90a9c06d5385babeea /src
parent61c5a9ae2b02c5bfafc3c1aaf8ceaeadfbcee96d (diff)
downloadtor-1b0134dda8d877f8917f86cf8d3b42fa41ffb625.tar
tor-1b0134dda8d877f8917f86cf8d3b42fa41ffb625.tar.gz
Clean up some comments; remove some dead code
svn:r5493
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c5
-rw-r--r--src/or/circuitlist.c16
-rw-r--r--src/or/circuituse.c3
-rw-r--r--src/or/connection_edge.c2
4 files changed, 10 insertions, 16 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 67bdfff8c..f542804d2 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -411,8 +411,9 @@ circuit_n_conn_done(connection_t *or_conn, int status)
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)) {
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index ba58c71d2..8fceae19f 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -132,8 +132,8 @@ circuit_set_circid_orconn(circuit_t *circ, uint16_t id,
++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 @@ circuit_set_state(circuit_t *circ, int state)
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 @@ circuit_set_state(circuit_t *circ, int state)
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.
*/
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 308dbc2e5..c1a745e92 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -230,7 +230,8 @@ circuit_expire_building(time_t now)
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:
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 0764e255e..94113f52f 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -424,7 +424,7 @@ connection_ap_detach_retriable(connection_t *conn, circuit_t *circ)
}
/** 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: