diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-03-26 14:08:18 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-03-26 14:08:18 +0000 |
commit | d1381aef827d328ab80d11e0b9c478ec2b6f2d70 (patch) | |
tree | 3d7bbd4f4c615a442002e5c9c8f17c3ea8e5a493 /src/or/connection.c | |
parent | 38c0bb3a99956a0ff2e570bd8f2b900d46741992 (diff) | |
download | tor-d1381aef827d328ab80d11e0b9c478ec2b6f2d70.tar.gz tor-d1381aef827d328ab80d11e0b9c478ec2b6f2d70.zip |
r12652@Kushana: nickm | 2007-03-25 15:01:48 -0400
A surprisingly simple patch to stop reading on edge connections when their circuits get too full, and start again when they empty out. This lets us remove the logic to block begin_dir conns when the corresponding or conns get full: it was already broken by cell queues anyway.
svn:r9905
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 0d21ee759c..2163c82349 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -416,10 +416,6 @@ connection_about_to_close_connection(connection_t *conn) } if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC) rend_client_desc_here(dir_conn->rend_query); /* give it a try */ - /* If this is from BEGIN_DIR, unlink it from the edge_conn and - * the or_conn. */ - if (dir_conn->bridge_conn) - connection_dirserv_unlink_from_bridge(dir_conn); break; case CONN_TYPE_OR: or_conn = TO_OR_CONN(conn); @@ -446,13 +442,6 @@ connection_about_to_close_connection(connection_t *conn) control_event_or_conn_status(or_conn, OR_CONN_EVENT_CLOSED, control_tls_error_to_reason(or_conn->tls_error)); } - /* Remove any dir_conns that are blocked on this one. Non-blocked - * ones will die when the circuits do. */ - while (or_conn->blocked_dir_connections) { - dir_connection_t *dir_conn = or_conn->blocked_dir_connections; - connection_dirserv_unlink_from_bridge(dir_conn); - tor_assert(or_conn->blocked_dir_connections != dir_conn); - } /* Now close all the attached circuits on it. */ circuit_unlink_all_from_or_conn(TO_OR_CONN(conn), END_CIRC_REASON_OR_CONN_CLOSED); @@ -485,9 +474,6 @@ connection_about_to_close_connection(connection_t *conn) if (conn->state == EXIT_CONN_STATE_RESOLVING) { connection_dns_remove(edge_conn); } - /* If we're relaying a dirserv connection, clean up any pointers */ - if (edge_conn->bridge_for_conn) - connection_dirserv_unlink_from_bridge(edge_conn->bridge_for_conn); break; } } @@ -2431,8 +2417,7 @@ assert_connection_ok(connection_t *conn, time_t now) if (conn->outbuf_flushlen > 0) { tor_assert(connection_is_writing(conn) || conn->wants_to_write || - (conn->type == CONN_TYPE_DIR && - TO_DIR_CONN(conn)->is_blocked_on_or_conn)); + conn->edge_blocked_on_circ); } if (conn->hold_open_until_flushed) @@ -2496,34 +2481,7 @@ assert_connection_ok(connection_t *conn, time_t now) tor_assert(conn->purpose == EXIT_PURPOSE_CONNECT || conn->purpose == EXIT_PURPOSE_RESOLVE); } - if (edge_conn->bridge_for_conn) { - tor_assert(conn->type == CONN_TYPE_EXIT); - tor_assert(edge_conn->bridge_for_conn->bridge_conn == edge_conn); - } } else if (conn->type == CONN_TYPE_DIR) { - dir_connection_t *dir_conn = TO_DIR_CONN(conn); - - if (dir_conn->bridge_conn) { - tor_assert(DIR_CONN_IS_SERVER(conn)); - tor_assert(dir_conn->bridge_conn->bridge_for_conn == dir_conn); - if (dir_conn->bridge_conn->on_circuit) { - dir_connection_t *d; - or_connection_t *or_conn; - tor_assert(!CIRCUIT_IS_ORIGIN(dir_conn->bridge_conn->on_circuit)); - or_conn = TO_OR_CIRCUIT(dir_conn->bridge_conn->on_circuit)->p_conn; - if (dir_conn->is_blocked_on_or_conn) - tor_assert(or_conn); - for (d = or_conn->blocked_dir_connections; d; - d = d->next_blocked_on_same_or_conn) { - if (d == dir_conn) { - tor_assert(dir_conn->is_blocked_on_or_conn == 1); - break; - } - } - if (!d) - tor_assert(!dir_conn->is_blocked_on_or_conn); - } - } } else { /* Purpose is only used for dir and exit types currently */ tor_assert(!conn->purpose); |