diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-07-26 19:05:34 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-07-26 19:05:34 +0000 |
commit | a88ec48a39e5531fa80a0b5d5ec42dd31f268b67 (patch) | |
tree | cb2386170a1f452e113720dd0ee7726e02f3dd9a /src/or/circuitlist.c | |
parent | f2dc012accd60312a67eb83c14691667235c9017 (diff) | |
download | tor-a88ec48a39e5531fa80a0b5d5ec42dd31f268b67.tar.gz tor-a88ec48a39e5531fa80a0b5d5ec42dd31f268b67.zip |
r6902@Kushana: nickm | 2006-07-25 17:30:27 -0400
Move rend_query to origin_circuit_t where it belongs; save another 17 bytes per OR circuit.
svn:r6903
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index dd9d7c2107..2751dde6bf 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -632,16 +632,18 @@ circuit_unlink_all_from_or_conn(connection_t *conn, int reason) * * Return NULL if no such circuit exists. */ -circuit_t * +origin_circuit_t * circuit_get_by_rend_query_and_purpose(const char *rend_query, uint8_t purpose) { circuit_t *circ; + tor_assert(CIRCUIT_PURPOSE_IS_ORIGIN(purpose)); + for (circ = global_circuitlist; circ; circ = circ->next) { if (!circ->marked_for_close && circ->purpose == purpose && - !rend_cmp_service_ids(rend_query, circ->rend_query)) - return circ; + !rend_cmp_service_ids(rend_query, TO_ORIGIN_CIRCUIT(circ)->rend_query)) + return TO_ORIGIN_CIRCUIT(circ); } return NULL; } @@ -854,10 +856,10 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int line, /* treat this like getting a nack from it */ log_info(LD_REND, "Failed intro circ %s to %s (awaiting ack). " "Removing from descriptor.", - safe_str(circ->rend_query), + safe_str(ocirc->rend_query), safe_str(build_state_get_exit_nickname(ocirc->build_state))); rend_client_remove_intro_point(ocirc->build_state->chosen_exit, - circ->rend_query); + ocirc->rend_query); } if (circ->n_conn) connection_or_send_destroy(circ->n_circ_id, circ->n_conn, reason); |