diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-17 14:59:28 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-17 14:59:28 +0000 |
commit | 7678ac5193d86bb060e182db0ce6b15c70cabbd2 (patch) | |
tree | 92c3440411cec25e2be609ec35f3f3a297b39ba6 /src/or/connection.c | |
parent | 26632d59dd34aef4834ee9844adeab5131248bf7 (diff) | |
download | tor-7678ac5193d86bb060e182db0ce6b15c70cabbd2.tar.gz tor-7678ac5193d86bb060e182db0ce6b15c70cabbd2.zip |
Move edge-only flags from connection_t to edge_connection_t.
svn:r17643
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 7a6a83a265..c540dbf311 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -511,7 +511,8 @@ connection_about_to_close_connection(connection_t *conn) tor_assert(conn->marked_for_close); if (CONN_IS_EDGE(conn)) { - if (!conn->edge_has_sent_end) { + edge_conn = TO_EDGE_CONN(conn); + if (!edge_conn->edge_has_sent_end) { log_warn(LD_BUG, "(Harmless.) Edge connection (marked at %s:%d) " "hasn't sent end yet?", conn->marked_for_close_file, conn->marked_for_close); @@ -2986,7 +2987,7 @@ assert_connection_ok(connection_t *conn, time_t now) if (conn->outbuf_flushlen > 0) { tor_assert(connection_is_writing(conn) || conn->write_blocked_on_bw || - conn->edge_blocked_on_circ); + (CONN_IS_EDGE(conn) && TO_EDGE_CONN(conn)->edge_blocked_on_circ)); } if (conn->hold_open_until_flushed) @@ -3001,11 +3002,6 @@ assert_connection_ok(connection_t *conn, time_t now) assert_buf_ok(conn->outbuf); } - if (conn->chosen_exit_optional || conn->chosen_exit_retries) { - tor_assert(conn->type == CONN_TYPE_AP); - tor_assert((TO_EDGE_CONN(conn))->chosen_exit_name); - } - if (conn->type == CONN_TYPE_OR) { or_connection_t *or_conn = TO_OR_CONN(conn); if (conn->state == OR_CONN_STATE_OPEN) { @@ -3025,6 +3021,11 @@ assert_connection_ok(connection_t *conn, time_t now) if (CONN_IS_EDGE(conn)) { edge_connection_t *edge_conn = TO_EDGE_CONN(conn); + if (edge_conn->chosen_exit_optional || edge_conn->chosen_exit_retries) { + tor_assert(conn->type == CONN_TYPE_AP); + tor_assert(edge_conn->chosen_exit_name); + } + /* XXX unchecked: package window, deliver window. */ if (conn->type == CONN_TYPE_AP) { |