diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2023-05-11 17:57:00 +0000 |
---|---|---|
committer | Mike Perry <mikeperry-git@torproject.org> | 2023-05-11 18:05:28 +0000 |
commit | 79dab29a0505e1cee1eee55f346415aeb70e8d6f (patch) | |
tree | 75a71d33bfcd76a550dd272bc18caccb2679da5f /src/core | |
parent | 0c115779871e05586cc1aa1526d4cc65aced2b0a (diff) | |
download | tor-79dab29a0505e1cee1eee55f346415aeb70e8d6f.tar.gz tor-79dab29a0505e1cee1eee55f346415aeb70e8d6f.zip |
Add torrc option for conflux client UX.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/conflux_pool.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/core/or/conflux_pool.c b/src/core/or/conflux_pool.c index b02b23f24d..c84613503f 100644 --- a/src/core/or/conflux_pool.c +++ b/src/core/or/conflux_pool.c @@ -36,6 +36,7 @@ #include "feature/nodelist/nodelist.h" #include "feature/client/bridges.h" +#include "app/config/config.h" #include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_util.h" @@ -1022,6 +1023,24 @@ get_exit_for_nonce(const uint8_t *nonce) return exit; } +/** + * Return the currently configured client UX. + */ +static uint8_t +get_client_ux(void) +{ +#ifdef TOR_UNIT_TESTS + return DEFAULT_CLIENT_UX; +#else + const or_options_t *opt = get_options(); + tor_assert(opt); + (void)DEFAULT_CLIENT_UX; + + /* Return the UX */ + return opt->ConfluxClientUX; +#endif +} + /** Return true iff the given conflux object is allowed to launch a new leg. If * the cfx object is NULL, then it is always allowed to launch a new leg. */ static bool @@ -1111,12 +1130,11 @@ conflux_launch_leg(const uint8_t *nonce) // arti-relay could (if resumption seems worthwhile; it may not be worth the // memory storage there, either). - /* We have a circuit, create the new leg and attach it to the set. - * TODO-329-TUNING: Should we make a torrc option to request min latency? */ + /* We have a circuit, create the new leg and attach it to the set. */ leg_t *leg = leg_new(TO_CIRCUIT(circ), conflux_cell_new_link(nonce, last_seq_sent, last_seq_recv, - DEFAULT_CLIENT_UX)); + get_client_ux())); /* Increase the retry count for this conflux object as in this nonce. */ unlinked->cfx->num_leg_launch++; |