瀏覽代碼

Remove the unused circuit_dump_by_chan().

Also remove its helper function.
Nick Mathewson 10 年之前
父節點
當前提交
f560eeadc3
共有 3 個文件被更改,包括 3 次插入67 次删除
  1. 3 0
      changes/bug9107
  2. 0 66
      src/or/circuitlist.c
  3. 0 1
      src/or/circuitlist.h

+ 3 - 0
changes/bug9107

@@ -0,0 +1,3 @@
+ o Code simplifications and refactoring: 
+   - Remove unused function circuit_dump_by_chan from circuitlist.c. Closes
+     issue #9107; patch from "marek".

+ 0 - 66
src/or/circuitlist.c

@@ -930,72 +930,6 @@ circuit_dump_by_conn(connection_t *conn, int severity)
   }
 }
 
-/** A helper function for circuit_dump_by_chan() below. Log a bunch
- * of information about circuit <b>circ</b>.
- */
-static void
-circuit_dump_chan_details(int severity,
-                          circuit_t *circ,
-                          channel_t *chan,
-                          const char *type,
-                          circid_t this_circid,
-                          circid_t other_circid)
-{
-  tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %u "
-      "(other side %u), state %d (%s), born %ld:",
-      chan, type, (unsigned)this_circid, (unsigned)other_circid, circ->state,
-      circuit_state_to_string(circ->state),
-      (long)circ->timestamp_began.tv_sec);
-  if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
-    circuit_log_path(severity, LD_CIRC, TO_ORIGIN_CIRCUIT(circ));
-  }
-}
-
-/** Log, at severity <b>severity</b>, information about each circuit
- * that is connected to <b>chan</b>.
- */
-void
-circuit_dump_by_chan(channel_t *chan, int severity)
-{
-  circuit_t *circ;
-
-  tor_assert(chan);
-
-  TOR_LIST_FOREACH(circ, &global_circuitlist, head) {
-    circid_t n_circ_id = circ->n_circ_id, p_circ_id = 0;
-
-    if (circ->marked_for_close) {
-      continue;
-    }
-
-    if (!CIRCUIT_IS_ORIGIN(circ)) {
-      p_circ_id = TO_OR_CIRCUIT(circ)->p_circ_id;
-    }
-
-    if (! CIRCUIT_IS_ORIGIN(circ) && TO_OR_CIRCUIT(circ)->p_chan &&
-        TO_OR_CIRCUIT(circ)->p_chan == chan) {
-      circuit_dump_chan_details(severity, circ, chan, "App-ward",
-                                p_circ_id, n_circ_id);
-    }
-
-    if (circ->n_chan && circ->n_chan == chan) {
-      circuit_dump_chan_details(severity, circ, chan, "Exit-ward",
-                                n_circ_id, p_circ_id);
-    }
-
-    if (!circ->n_chan && circ->n_hop &&
-        channel_matches_extend_info(chan, circ->n_hop) &&
-        tor_memeq(chan->identity_digest,
-                  circ->n_hop->identity_digest, DIGEST_LEN)) {
-      circuit_dump_chan_details(severity, circ, chan,
-                                (circ->state == CIRCUIT_STATE_OPEN &&
-                                 !CIRCUIT_IS_ORIGIN(circ)) ?
-                                "Endpoint" : "Pending",
-                                n_circ_id, p_circ_id);
-    }
-  }
-}
-
 /** Return the circuit whose global ID is <b>id</b>, or NULL if no
  * such circuit exists. */
 origin_circuit_t *

+ 0 - 1
src/or/circuitlist.h

@@ -22,7 +22,6 @@ const char *circuit_purpose_to_controller_string(uint8_t purpose);
 const char *circuit_purpose_to_controller_hs_state_string(uint8_t purpose);
 const char *circuit_purpose_to_string(uint8_t purpose);
 void circuit_dump_by_conn(connection_t *conn, int severity);
-void circuit_dump_by_chan(channel_t *chan, int severity);
 void circuit_set_p_circid_chan(or_circuit_t *circ, circid_t id,
                                channel_t *chan);
 void circuit_set_n_circid_chan(circuit_t *circ, circid_t id,