diff options
author | Taylor Yu <catalyst@torproject.org> | 2018-12-15 22:14:46 -0600 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-12-21 14:15:35 -0500 |
commit | 936c93e562deaba62f0d32f7e7fda770c5604318 (patch) | |
tree | 66320e5dcffecd423cf3d73fba17f2a5c1c243a4 /src/feature/control/btrack_orconn.c | |
parent | 9d29abb34e005f4e836976a4c00115a1e8977071 (diff) | |
download | tor-936c93e562deaba62f0d32f7e7fda770c5604318.tar.gz tor-936c93e562deaba62f0d32f7e7fda770c5604318.zip |
Hook up control_event_bootstrap() to btrack_orconn
Replace a few invocations of control_event_bootstrap() with calls from
the bootstrap tracker subsystem. This mostly leaves behavior
unchanged. The actual behavior changes come in the next commit.
Part of ticket 27167.
Diffstat (limited to 'src/feature/control/btrack_orconn.c')
-rw-r--r-- | src/feature/control/btrack_orconn.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/feature/control/btrack_orconn.c b/src/feature/control/btrack_orconn.c index 28f8509fe2..0fbf521000 100644 --- a/src/feature/control/btrack_orconn.c +++ b/src/feature/control/btrack_orconn.c @@ -27,6 +27,10 @@ * might be a one-hop circuit for directory lookups, or it might be a * connection for an application circuit because we already have * enough directory info to build an application circuit. + * + * We call functions in btrack_orconn_cevent.c to generate the actual + * controller events, because some of the state decoding we need to do + * is complicated. **/ #include <stdbool.h> @@ -38,6 +42,7 @@ #include "core/or/ocirc_event.h" #include "core/or/orconn_event.h" #include "feature/control/btrack_orconn.h" +#include "feature/control/btrack_orconn_cevent.h" #include "feature/control/btrack_orconn_maps.h" #include "lib/log/log.h" @@ -86,9 +91,10 @@ bto_update_bests(const bt_orconn_t *bto) { tor_assert(bto->is_orig); - bto_update_best(bto, &best_any, "ANY"); - if (!bto->is_onehop) - bto_update_best(bto, &best_ap, "AP"); + if (bto_update_best(bto, &best_any, "ANY")) + bto_cevent_anyconn(bto); + if (!bto->is_onehop && bto_update_best(bto, &best_ap, "AP")) + bto_cevent_apconn(bto); } /** Reset cached "best" values */ @@ -196,4 +202,5 @@ btrack_orconn_fini(void) { bto_clear_maps(); bto_reset_bests(); + bto_cevent_reset(); } |