diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-09-07 14:13:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-09-07 14:13:57 -0400 |
commit | 0cb01f5c971e497706b209c3fe75aedd089e3c8a (patch) | |
tree | ce8a48e2255289d2c513dd1b7b8336f56dc9a37e /src/or/circuitbuild.c | |
parent | 8aad677bb7542376b053ecd12a0c6943e8cfa3c0 (diff) | |
parent | 569fe936b8349082d6f9dcd4e55f7d5758d236be (diff) | |
download | tor-0cb01f5c971e497706b209c3fe75aedd089e3c8a.tar.gz tor-0cb01f5c971e497706b209c3fe75aedd089e3c8a.zip |
Merge remote-tracking branch 'public/split_entry_conn'
Conflicts:
src/or/connection.c
src/or/connection_edge.c
src/or/connection_edge.h
src/or/dnsserv.c
Some of these were a little tricky, since they touched code that
changed because of the prop171 fixes.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index f7d5524cd8..39a50abafb 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2648,14 +2648,19 @@ node_handles_some_port(const node_t *node, smartlist_t *needed_ports) static int ap_stream_wants_exit_attention(connection_t *conn) { + entry_connection_t *entry; + if (conn->type != CONN_TYPE_AP) + return 0; + entry = TO_ENTRY_CONN(conn); + if (conn->type == CONN_TYPE_AP && conn->state == AP_CONN_STATE_CIRCUIT_WAIT && !conn->marked_for_close && - !(TO_EDGE_CONN(conn)->want_onehop) && /* ignore one-hop streams */ - !(TO_EDGE_CONN(conn)->use_begindir) && /* ignore targeted dir fetches */ - !(TO_EDGE_CONN(conn)->chosen_exit_name) && /* ignore defined streams */ + !(entry->want_onehop) && /* ignore one-hop streams */ + !(entry->use_begindir) && /* ignore targeted dir fetches */ + !(entry->chosen_exit_name) && /* ignore defined streams */ !connection_edge_is_rendezvous_stream(TO_EDGE_CONN(conn)) && - !circuit_stream_is_being_handled(TO_EDGE_CONN(conn), 0, + !circuit_stream_is_being_handled(TO_ENTRY_CONN(conn), 0, MIN_CIRCUITS_HANDLING_STREAM)) return 1; return 0; @@ -2760,7 +2765,7 @@ choose_good_exit_server_general(int need_uptime, int need_capacity) SMARTLIST_FOREACH_BEGIN(connections, connection_t *, conn) { if (!ap_stream_wants_exit_attention(conn)) continue; /* Skip everything but APs in CIRCUIT_WAIT */ - if (connection_ap_can_use_exit(TO_EDGE_CONN(conn), node)) { + if (connection_ap_can_use_exit(TO_ENTRY_CONN(conn), node)) { ++n_supported[i]; // log_fn(LOG_DEBUG,"%s is supported. n_supported[%d] now %d.", // router->nickname, i, n_supported[i]); |