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/app | |
parent | 0c115779871e05586cc1aa1526d4cc65aced2b0a (diff) | |
download | tor-79dab29a0505e1cee1eee55f346415aeb70e8d6f.tar.gz tor-79dab29a0505e1cee1eee55f346415aeb70e8d6f.zip |
Add torrc option for conflux client UX.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/config.c | 18 | ||||
-rw-r--r-- | src/app/config/or_options_st.h | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 24321b764f..e2de72c855 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -77,6 +77,7 @@ #include "core/or/circuitmux_ewma.h" #include "core/or/circuitstats.h" #include "core/or/connection_edge.h" +#include "trunnel/conflux.h" #include "core/or/dos.h" #include "core/or/policies.h" #include "core/or/relay.h" @@ -380,6 +381,8 @@ static const config_var_t option_vars_[] = { V(ClientUseIPv6, BOOL, "0"), V(ClientUseIPv4, BOOL, "1"), V(ConfluxEnabled, AUTOBOOL, "auto"), + VAR("ConfluxClientUX", STRING, ConfluxClientUX_option, + "throughput"), V(ConnLimit, POSINT, "1000"), V(ConnDirectionStatistics, BOOL, "0"), V(ConstrainedSockets, BOOL, "0"), @@ -3545,6 +3548,21 @@ options_validate_cb(const void *old_options_, void *options_, char **msg) return -1; } + options->ConfluxClientUX = CONFLUX_UX_HIGH_THROUGHPUT; + if (options->ConfluxClientUX_option) { + if (!strcmp(options->ConfluxClientUX_option, "latency")) + options->ConfluxClientUX = CONFLUX_UX_MIN_LATENCY; + else if (!strcmp(options->ConfluxClientUX_option, "throughput")) + options->ConfluxClientUX = CONFLUX_UX_HIGH_THROUGHPUT; + else if (!strcmp(options->ConfluxClientUX_option, "latency_lowmem")) + options->ConfluxClientUX = CONFLUX_UX_LOW_MEM_LATENCY; + else if (!strcmp(options->ConfluxClientUX_option, "throughput_lowmem")) + options->ConfluxClientUX = CONFLUX_UX_LOW_MEM_THROUGHPUT; + else + REJECT("ConfluxClientUX must be 'latency', 'throughput, " + "'latency_lowmem', or 'throughput_lowmem'"); + } + if (options_validate_publish_server(old_options, options, msg) < 0) return -1; diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h index 056aa3b776..c8680bb49e 100644 --- a/src/app/config/or_options_st.h +++ b/src/app/config/or_options_st.h @@ -727,6 +727,10 @@ struct or_options_t { * circuits which excludes onion service traffic. */ int ConfluxEnabled; + /** Has the UX integer value that the client will request from the exit. */ + char *ConfluxClientUX_option; + int ConfluxClientUX; + /** The length of time that we think a consensus should be fresh. */ int V3AuthVotingInterval; /** The length of time we think it will take to distribute votes. */ |