aboutsummaryrefslogtreecommitdiff
path: root/src/app/config/config.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2023-05-11 17:57:00 +0000
committerMike Perry <mikeperry-git@torproject.org>2023-05-11 18:05:28 +0000
commit79dab29a0505e1cee1eee55f346415aeb70e8d6f (patch)
tree75a71d33bfcd76a550dd272bc18caccb2679da5f /src/app/config/config.c
parent0c115779871e05586cc1aa1526d4cc65aced2b0a (diff)
downloadtor-79dab29a0505e1cee1eee55f346415aeb70e8d6f.tar.gz
tor-79dab29a0505e1cee1eee55f346415aeb70e8d6f.zip
Add torrc option for conflux client UX.
Diffstat (limited to 'src/app/config/config.c')
-rw-r--r--src/app/config/config.c18
1 files changed, 18 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;