mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Merge branch 'extract_selftest'
This commit is contained in:
commit
7b6e81f8e6
3 changed files with 34 additions and 2 deletions
3
changes/ticket33370
Normal file
3
changes/ticket33370
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
o Minor features (client-only compilation):
|
||||||
|
- Disable more of our self-testing code when support for relay mode is
|
||||||
|
disabled. Closes ticket 33370.
|
|
@ -5,8 +5,7 @@ LIBTOR_APP_A_SOURCES += \
|
||||||
src/feature/relay/ext_orport.c \
|
src/feature/relay/ext_orport.c \
|
||||||
src/feature/relay/onion_queue.c \
|
src/feature/relay/onion_queue.c \
|
||||||
src/feature/relay/router.c \
|
src/feature/relay/router.c \
|
||||||
src/feature/relay/routerkeys.c \
|
src/feature/relay/routerkeys.c
|
||||||
src/feature/relay/selftest.c
|
|
||||||
|
|
||||||
# The Relay module.
|
# The Relay module.
|
||||||
|
|
||||||
|
@ -16,6 +15,7 @@ MODULE_RELAY_SOURCES = \
|
||||||
src/feature/relay/relay_config.c \
|
src/feature/relay/relay_config.c \
|
||||||
src/feature/relay/relay_periodic.c \
|
src/feature/relay/relay_periodic.c \
|
||||||
src/feature/relay/relay_sys.c \
|
src/feature/relay/relay_sys.c \
|
||||||
|
src/feature/relay/selftest.c \
|
||||||
src/feature/relay/transport_config.c
|
src/feature/relay/transport_config.c
|
||||||
|
|
||||||
# ADD_C_FILE: INSERT HEADERS HERE.
|
# ADD_C_FILE: INSERT HEADERS HERE.
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#ifndef TOR_SELFTEST_H
|
#ifndef TOR_SELFTEST_H
|
||||||
#define TOR_SELFTEST_H
|
#define TOR_SELFTEST_H
|
||||||
|
|
||||||
|
#ifdef HAVE_MODULE_RELAY
|
||||||
struct or_options_t;
|
struct or_options_t;
|
||||||
int check_whether_orport_reachable(const struct or_options_t *options);
|
int check_whether_orport_reachable(const struct or_options_t *options);
|
||||||
int check_whether_dirport_reachable(const struct or_options_t *options);
|
int check_whether_dirport_reachable(const struct or_options_t *options);
|
||||||
|
@ -20,5 +21,33 @@ void router_do_reachability_checks(int test_or, int test_dir);
|
||||||
void router_orport_found_reachable(void);
|
void router_orport_found_reachable(void);
|
||||||
void router_dirport_found_reachable(void);
|
void router_dirport_found_reachable(void);
|
||||||
void router_perform_bandwidth_test(int num_circs, time_t now);
|
void router_perform_bandwidth_test(int num_circs, time_t now);
|
||||||
|
#else /* !defined(HAVE_MODULE_RELAY) */
|
||||||
|
|
||||||
|
#define check_whether_orport_reachable(opts) \
|
||||||
|
((void)(opts), 0)
|
||||||
|
#define check_whether_dirport_reachable(opts) \
|
||||||
|
((void)(opts), 0)
|
||||||
|
|
||||||
|
#define router_orport_found_reachable() \
|
||||||
|
STMT_NIL
|
||||||
|
#define router_dirport_found_reachable() \
|
||||||
|
STMT_NIL
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
router_do_reachability_checks(int test_or, int test_dir)
|
||||||
|
{
|
||||||
|
(void)test_or;
|
||||||
|
(void)test_dir;
|
||||||
|
tor_assert_nonfatal_unreached();
|
||||||
|
}
|
||||||
|
static inline void
|
||||||
|
router_perform_bandwidth_test(int num_circs, time_t now)
|
||||||
|
{
|
||||||
|
(void)num_circs;
|
||||||
|
(void)now;
|
||||||
|
tor_assert_nonfatal_unreached();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* defined(HAVE_MODULE_RELAY) */
|
||||||
|
|
||||||
#endif /* !defined(TOR_SELFTEST_H) */
|
#endif /* !defined(TOR_SELFTEST_H) */
|
||||||
|
|
Loading…
Add table
Reference in a new issue