}
}
-/** Warns the user of possible pluggable transport misconfiguration. */
-void
+/** Warn the user of possible pluggable transport misconfiguration.
+ * Return 0 if the validation happened, -1 if we should postpone the
+ * validation. */
+int
validate_pluggable_transports_config(void)
{
- if (bridge_list) {
+ /* Don't validate if managed proxies are not yet fully configured. */
+ if (bridge_list && !pt_proxies_configuration_pending()) {
SMARTLIST_FOREACH_BEGIN(bridge_list, bridge_info_t *, b) {
/* Skip bridges without transports. */
if (!b->transport_name)
"corresponding ClientTransportPlugin line.",
b->transport_name);
} SMARTLIST_FOREACH_END(b);
+
+ return 0;
+ } else {
+ return -1;
}
}
const transport_t **transport);
transport_t *transport_get_by_name(const char *name);
-void validate_pluggable_transports_config(void);
+int validate_pluggable_transports_config(void);
#endif
sweep_transport_list();
sweep_proxy_list();
- /* If we have pluggable transport related options enabled, see if we
- should warn the user about potential configuration problems. */
- if (options->Bridges || options->ClientTransportPlugin)
- validate_pluggable_transports_config();
-
/* Bail out at this point if we're not going to be a client or server:
* we want to not fork, and to log stuff to stderr. */
if (!running_tor)
static int should_init_bridge_stats = 1;
static time_t time_to_retry_dns_init = 0;
static time_t time_to_next_heartbeat = 0;
+ static int has_validated_pt = 0;
or_options_t *options = get_options();
int is_server = server_mode(options);
int i;
if (pt_proxies_configuration_pending())
pt_configure_remaining_proxies();
+ /** 11c. validate pluggable transports configuration if we need to */
+ if (!has_validated_pt &&
+ (options->Bridges || options->ClientTransportPlugin)) {
+ if (validate_pluggable_transports_config() == 0) {
+ has_validated_pt = 1;
+ }
+ }
+
/** 12. write the heartbeat message */
if (options->HeartbeatPeriod &&
time_to_next_heartbeat < now) {