Fix compilation of 3335 and 3825 fixes

In master, they ran into problems with the edge_conn/entry_conn split.
This commit is contained in:
Nick Mathewson 2011-10-03 15:13:38 -04:00
parent 4aa4bce474
commit 05f672c8c2
2 changed files with 8 additions and 5 deletions

View file

@ -1589,11 +1589,12 @@ link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ,
/* assert_connection_ok(conn, time(NULL)); */ /* assert_connection_ok(conn, time(NULL)); */
circ->p_streams = ENTRY_TO_EDGE_CONN(apconn); circ->p_streams = ENTRY_TO_EDGE_CONN(apconn);
if (connection_edge_is_rendezvous_stream(apconn)) { if (connection_edge_is_rendezvous_stream(ENTRY_TO_EDGE_CONN(apconn))) {
/* We are attaching a stream to a rendezvous circuit. That means /* We are attaching a stream to a rendezvous circuit. That means
* that an attempt to connect to a hidden service just * that an attempt to connect to a hidden service just
* succeeded. Tell rendclient.c. */ * succeeded. Tell rendclient.c. */
rend_client_note_connection_attempt_ended(apconn->rend_data->onion_address); rend_client_note_connection_attempt_ended(
ENTRY_TO_EDGE_CONN(apconn)->rend_data->onion_address);
} }
if (cpath) { /* we were given one; use it */ if (cpath) { /* we were given one; use it */

View file

@ -68,6 +68,7 @@ _connection_mark_unattached_ap(entry_connection_t *conn, int endreason,
int line, const char *file) int line, const char *file)
{ {
connection_t *base_conn = ENTRY_TO_CONN(conn); connection_t *base_conn = ENTRY_TO_CONN(conn);
edge_connection_t *edge_conn = ENTRY_TO_EDGE_CONN(conn);
tor_assert(base_conn->type == CONN_TYPE_AP); tor_assert(base_conn->type == CONN_TYPE_AP);
ENTRY_TO_EDGE_CONN(conn)->edge_has_sent_end = 1; /* no circ yet */ ENTRY_TO_EDGE_CONN(conn)->edge_has_sent_end = 1; /* no circ yet */
@ -78,9 +79,10 @@ _connection_mark_unattached_ap(entry_connection_t *conn, int endreason,
* XXX023 This condition doesn't limit to only streams failing * XXX023 This condition doesn't limit to only streams failing
* without ever being attached. That sloppiness should be harmless, * without ever being attached. That sloppiness should be harmless,
* but we should fix it someday anyway. */ * but we should fix it someday anyway. */
if ((conn->on_circuit != NULL || conn->edge_has_sent_end) && if ((edge_conn->on_circuit != NULL || edge_conn->edge_has_sent_end) &&
connection_edge_is_rendezvous_stream(conn)) { connection_edge_is_rendezvous_stream(edge_conn)) {
rend_client_note_connection_attempt_ended(conn->rend_data->onion_address); rend_client_note_connection_attempt_ended(
edge_conn->rend_data->onion_address);
} }
if (base_conn->marked_for_close) { if (base_conn->marked_for_close) {