Remove some dead code.

svn:r18301
This commit is contained in:
Nick Mathewson 2009-01-28 17:36:34 +00:00
parent 8027c8c6dd
commit 0d5f4d4e73

View File

@ -331,48 +331,6 @@ circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, int flags)
return circ; return circ;
} }
#if 0
/** Return true iff <b>n_conn</b> (a connection with a desired identity), is
* an acceptable choice for extending or launching a circuit to the address
* <b>target_addr</b>. If it is not, set <b>state_out</b> to a message
* describing the connection's state and our next action, and set
* <b>launch_out</b> to a boolean for whether we should launch a new
* connection or not. */
int
connection_good_enough_for_extend(const or_connection_t *n_conn,
const tor_addr_t *target_addr,
const char **state_out,
int *launch_out)
{
tor_assert(state_out);
tor_assert(launch_out);
tor_assert(target_addr);
if (!n_conn) {
*state_out = "not connected. Connecting.";
*launch_out = 1;
return 0;
} else if (n_conn->_base.state != OR_CONN_STATE_OPEN) {
*state_out = "in progress. Waiting.";
*launch_out = 0; /* We'll just wait till the connection finishes. */
return 0;
} else if (n_conn->is_bad_for_new_circs) {
*state_out = "too old. Launching a new one.";
*launch_out = 1;
return 0;
} else if (tor_addr_compare(&n_conn->real_addr, target_addr, CMP_EXACT)
&& ! n_conn->is_canonical) {
*state_out = "is not from a canonical address. Launching a new one.";
*launch_out = 1;
return 0;
} else {
*state_out = "is fine; using it.";
*launch_out = 0;
return 1;
}
}
#endif
/** Start establishing the first hop of our circuit. Figure out what /** Start establishing the first hop of our circuit. Figure out what
* OR we should connect to, and if necessary start the connection to * OR we should connect to, and if necessary start the connection to
* it. If we're already connected, then send the 'create' cell. * it. If we're already connected, then send the 'create' cell.