|
@@ -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 *
|