Loading src/core/or/congestion_control_common.c +12 −3 Original line number Diff line number Diff line Loading @@ -90,9 +90,6 @@ static bool congestion_control_update_circuit_bdp(congestion_control_t *, const circuit_t *, const crypt_path_t *, uint64_t, uint64_t); /* For unit tests */ void congestion_control_set_cc_enabled(void); /* Number of times the RTT value was reset. For MetricsPort. */ static uint64_t num_rtt_reset; Loading Loading @@ -387,6 +384,7 @@ congestion_control_enabled(void) return cc_alg != CC_ALG_SENDME; } #ifdef TOR_UNIT_TESTS /** * For unit tests only: set the cached consensus cc alg to * specified value. Loading @@ -397,6 +395,17 @@ congestion_control_set_cc_enabled(void) cc_alg = CC_ALG_VEGAS; } /** * For unit tests only: set the cached consensus cc alg to * specified value. */ void congestion_control_set_cc_disabled(void) { cc_alg = CC_ALG_SENDME; } #endif /** * Allocate and initialize fields in congestion control object. * Loading src/core/or/congestion_control_common.h +2 −1 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ percent_max_mix(uint64_t a, uint64_t b, uint8_t pct_max) } /* Private section starts. */ #ifdef TOR_CONGESTION_CONTROL_PRIVATE #ifdef TOR_CONGESTION_CONTROL_COMMON_PRIVATE /* * Unit tests declaractions. Loading @@ -182,6 +182,7 @@ percent_max_mix(uint64_t a, uint64_t b, uint8_t pct_max) #ifdef TOR_UNIT_TESTS void congestion_control_set_cc_enabled(void); void congestion_control_set_cc_disabled(void); #endif /* defined(TOR_UNIT_TESTS) */ Loading src/test/test_conflux_pool.c +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #define CRYPT_PATH_PRIVATE #define RELAY_PRIVATE #define CONNECTION_PRIVATE #define TOR_CONGESTION_CONTROL_COMMON_PRIVATE #define TOR_CONGESTION_CONTROL_PRIVATE #include "core/or/or.h" Loading @@ -25,8 +26,8 @@ #include "core/or/circuitstats.h" #include "core/or/circuitbuild.h" #include "core/or/circuituse.h" #include "core/or/congestion_control_common.h" #include "core/or/congestion_control_st.h" #include "core/or/congestion_control_common.h" #include "core/or/extendinfo.h" #include "core/mainloop/netstatus.h" #include "core/crypto/relay_crypto.h" Loading src/test/test_hs_client.c +1 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define CIRCUITLIST_PRIVATE #define CONNECTION_PRIVATE #define CRYPT_PATH_PRIVATE #define TOR_CONGESTION_CONTROL_COMMON_PRIVATE #include "test/test.h" #include "test/test_helpers.h" Loading Loading @@ -54,7 +55,6 @@ #include "core/or/origin_circuit_st.h" #include "core/or/socks_request_st.h" #define TOR_CONGESTION_CONTROL_PRIVATE #include "core/or/congestion_control_common.h" static int Loading src/test/test_hs_descriptor.c +1 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ */ #define HS_DESCRIPTOR_PRIVATE #define TOR_CONGESTION_CONTROL_COMMON_PRIVATE #include "lib/crypt_ops/crypto_ed25519.h" #include "lib/crypt_ops/crypto_format.h" Loading @@ -24,7 +25,6 @@ #include "test/log_test_helpers.h" #include "test/rng_test_helpers.h" #define TOR_CONGESTION_CONTROL_PRIVATE #include "core/or/congestion_control_common.h" #ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS Loading Loading
src/core/or/congestion_control_common.c +12 −3 Original line number Diff line number Diff line Loading @@ -90,9 +90,6 @@ static bool congestion_control_update_circuit_bdp(congestion_control_t *, const circuit_t *, const crypt_path_t *, uint64_t, uint64_t); /* For unit tests */ void congestion_control_set_cc_enabled(void); /* Number of times the RTT value was reset. For MetricsPort. */ static uint64_t num_rtt_reset; Loading Loading @@ -387,6 +384,7 @@ congestion_control_enabled(void) return cc_alg != CC_ALG_SENDME; } #ifdef TOR_UNIT_TESTS /** * For unit tests only: set the cached consensus cc alg to * specified value. Loading @@ -397,6 +395,17 @@ congestion_control_set_cc_enabled(void) cc_alg = CC_ALG_VEGAS; } /** * For unit tests only: set the cached consensus cc alg to * specified value. */ void congestion_control_set_cc_disabled(void) { cc_alg = CC_ALG_SENDME; } #endif /** * Allocate and initialize fields in congestion control object. * Loading
src/core/or/congestion_control_common.h +2 −1 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ percent_max_mix(uint64_t a, uint64_t b, uint8_t pct_max) } /* Private section starts. */ #ifdef TOR_CONGESTION_CONTROL_PRIVATE #ifdef TOR_CONGESTION_CONTROL_COMMON_PRIVATE /* * Unit tests declaractions. Loading @@ -182,6 +182,7 @@ percent_max_mix(uint64_t a, uint64_t b, uint8_t pct_max) #ifdef TOR_UNIT_TESTS void congestion_control_set_cc_enabled(void); void congestion_control_set_cc_disabled(void); #endif /* defined(TOR_UNIT_TESTS) */ Loading
src/test/test_conflux_pool.c +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #define CRYPT_PATH_PRIVATE #define RELAY_PRIVATE #define CONNECTION_PRIVATE #define TOR_CONGESTION_CONTROL_COMMON_PRIVATE #define TOR_CONGESTION_CONTROL_PRIVATE #include "core/or/or.h" Loading @@ -25,8 +26,8 @@ #include "core/or/circuitstats.h" #include "core/or/circuitbuild.h" #include "core/or/circuituse.h" #include "core/or/congestion_control_common.h" #include "core/or/congestion_control_st.h" #include "core/or/congestion_control_common.h" #include "core/or/extendinfo.h" #include "core/mainloop/netstatus.h" #include "core/crypto/relay_crypto.h" Loading
src/test/test_hs_client.c +1 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define CIRCUITLIST_PRIVATE #define CONNECTION_PRIVATE #define CRYPT_PATH_PRIVATE #define TOR_CONGESTION_CONTROL_COMMON_PRIVATE #include "test/test.h" #include "test/test_helpers.h" Loading Loading @@ -54,7 +55,6 @@ #include "core/or/origin_circuit_st.h" #include "core/or/socks_request_st.h" #define TOR_CONGESTION_CONTROL_PRIVATE #include "core/or/congestion_control_common.h" static int Loading
src/test/test_hs_descriptor.c +1 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ */ #define HS_DESCRIPTOR_PRIVATE #define TOR_CONGESTION_CONTROL_COMMON_PRIVATE #include "lib/crypt_ops/crypto_ed25519.h" #include "lib/crypt_ops/crypto_format.h" Loading @@ -24,7 +25,6 @@ #include "test/log_test_helpers.h" #include "test/rng_test_helpers.h" #define TOR_CONGESTION_CONTROL_PRIVATE #include "core/or/congestion_control_common.h" #ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS Loading