}
#endif
+/* For unit tests only: please treat these exactly as the defines in the
+ * code. */
+STATIC uint8_t DEFAULT_CLIENT_UX = CONFLUX_UX_HIGH_THROUGHPUT;
+STATIC uint8_t DEFAULT_EXIT_UX = CONFLUX_UX_MIN_LATENCY;
+
/** Helper: Format at 8 bytes the nonce for logging. */
static inline const char *
fmt_nonce(const uint8_t *nonce)
leg_t *leg = leg_new(TO_CIRCUIT(circ),
conflux_cell_new_link(nonce,
last_seq_sent, last_seq_recv,
- CONFLUX_UX_HIGH_THROUGHPUT));
+ DEFAULT_CLIENT_UX));
/* Increase the retry count for this conflux object as in this nonce. */
unlinked->cfx->num_leg_launch++;
/* Exits should always request min latency from clients */
conflux_cell_link_t *linked = conflux_cell_new_link(nonce, last_seq_sent,
last_seq_recv,
- CONFLUX_UX_MIN_LATENCY);
+ DEFAULT_EXIT_UX);
conflux_cell_send_linked(linked, TO_OR_CIRCUIT(circ));
tor_free(linked);
bool launch_new_set(int num_legs);
digest256map_t *get_linked_pool(bool is_client);
digest256map_t *get_unlinked_pool(bool is_client);
+extern uint8_t DEFAULT_CLIENT_UX;
+extern uint8_t DEFAULT_EXIT_UX;
#endif /* defined(UNIT_TESTS) */
#endif /* TOR_CONFLUX_POOL_H */
#include "core/or/conflux_params.h"
#include "core/or/conflux.h"
#include "core/or/conflux_st.h"
+#include "trunnel/conflux.h"
#include "lib/crypt_ops/crypto_rand.h"
/* Start our monotime mocking at 1 second past whatever monotime_init()
{
(void) arg;
test_setup();
+ DEFAULT_EXIT_UX = CONFLUX_UX_HIGH_THROUGHPUT;
launch_new_set(2);