]> git.ipfire.org Git - thirdparty/tor.git/commit
Decouple ..attach_circuit() from most of its callers.
authorNick Mathewson <nickm@torproject.org>
Fri, 13 Nov 2015 18:38:01 +0000 (13:38 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 17 Nov 2015 13:53:34 +0000 (08:53 -0500)
commitb1d56fc5890fb6d594e70520c09d040e9b2e1544
tree8777eb9aaa8b1f53ad136b34c4408fa0f1a0b899
parentb91bd27e6f94e76359097e1ec53494ea5168108d
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
changes/decouple_conn_attach [new file with mode: 0644]
src/or/circuituse.c
src/or/connection_edge.c
src/or/connection_edge.h
src/or/main.c
src/or/rendclient.c