diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-11-13 13:38:01 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-11-17 08:53:34 -0500 |
commit | b1d56fc5890fb6d594e70520c09d040e9b2e1544 (patch) | |
tree | 8777eb9aaa8b1f53ad136b34c4408fa0f1a0b899 /src/or/connection_edge.h | |
parent | b91bd27e6f94e76359097e1ec53494ea5168108d (diff) | |
download | tor-b1d56fc5890fb6d594e70520c09d040e9b2e1544.tar.gz tor-b1d56fc5890fb6d594e70520c09d040e9b2e1544.zip |
Decouple ..attach_circuit() from most of its callers.
Long ago we used to call connection_ap_handshake_attach_circuit()
only in a few places, since connection_ap_attach_pending() attaches
all the pending connections, and does so regularly. But this turned
out to have a performance problem: it would introduce a delay to
launching or connecting a stream.
We couldn't just call connection_ap_attach_pending() every time we
make a new connection, since it walks the whole connection list. So
we started calling connection_ap_attach_pending all over, instead!
But that's kind of ugly and messes up our callgraph.
So instead, we now have connection_ap_attach_pending() use a list
only of the pending connections, so we can call it much more
frequently. We have a separate function to scan the whole
connection array to see if we missed adding anything, and log a
warning if so.
Closes ticket #17590
Diffstat (limited to 'src/or/connection_edge.h')
-rw-r--r-- | src/or/connection_edge.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h index 7c0b9c0767..203099976f 100644 --- a/src/or/connection_edge.h +++ b/src/or/connection_edge.h @@ -64,7 +64,9 @@ int connection_edge_is_rendezvous_stream(edge_connection_t *conn); int connection_ap_can_use_exit(const entry_connection_t *conn, const node_t *exit); void connection_ap_expire_beginning(void); +void connection_ap_rescan_and_attach_pending(void); void connection_ap_attach_pending(void); +void connection_ap_mark_as_pending_circuit(entry_connection_t *entry_conn); void connection_ap_fail_onehop(const char *failed_digest, cpath_build_state_t *build_state); void circuit_discard_optional_exit_enclaves(extend_info_t *info); |