Various small tweaks around config.c and or.h

This commit is contained in:
George Kadianakis 2011-06-21 18:49:04 +02:00
parent 298f170036
commit 5a05deb574
2 changed files with 12 additions and 27 deletions

View File

@ -1208,8 +1208,8 @@ options_act(or_options_t *old_options)
if (consider_adding_dir_authorities(options, old_options) < 0) if (consider_adding_dir_authorities(options, old_options) < 0)
return -1; return -1;
clear_transport_list();
if (options->ClientTransportPlugin) { if (options->ClientTransportPlugin) {
clear_transport_list();
for (cl = options->ClientTransportPlugin; cl; cl = cl->next) { for (cl = options->ClientTransportPlugin; cl; cl = cl->next) {
if (parse_client_transport_line(cl->value, 0)<0) { if (parse_client_transport_line(cl->value, 0)<0) {
log_warn(LD_BUG, log_warn(LD_BUG,
@ -1232,14 +1232,6 @@ options_act(or_options_t *old_options)
sweep_bridge_list(); sweep_bridge_list();
} }
/** Okay, we have Bridges and we have ClientTransportPlugins. Let's
match them together. */
if (options->Bridges && options->ClientTransportPlugin) {
assert(!server_mode(options));
if (match_bridges_with_transports() < 0)
return -1;
}
if (running_tor && rend_config_services(options, 0)<0) { if (running_tor && rend_config_services(options, 0)<0) {
log_warn(LD_BUG, log_warn(LD_BUG,
"Previously validated hidden services line could not be added!"); "Previously validated hidden services line could not be added!");
@ -3566,15 +3558,9 @@ options_validate(or_options_t *old_options, or_options_t *options,
} }
} }
/* Check if more than one proxy type has been enabled. This looks REALLY ugly! */ /* Check if more than one proxy type has been enabled. */
if ((options->Socks4Proxy && (options->Socks5Proxy || options->HTTPSProxy if (!!options->Socks4Proxy + !!options->Socks5Proxy +
|| options->ClientTransportPlugin)) || !!options->HTTPSProxy + !!options->ClientTransportPlugin > 1)
(options->Socks5Proxy && (options->Socks4Proxy || options->HTTPSProxy
|| options->ClientTransportPlugin)) ||
(options->HTTPSProxy && (options->Socks4Proxy || options->Socks5Proxy
|| options->ClientTransportPlugin)) ||
(options->ClientTransportPlugin && (options->Socks4Proxy
|| options->Socks5Proxy || options->HTTPSProxy)))
REJECT("You have configured more than one proxy types. " REJECT("You have configured more than one proxy types. "
"(Socks4Proxy|Socks5Proxy|HTTPSProxy|ClientTransportPlugin)"); "(Socks4Proxy|Socks5Proxy|HTTPSProxy|ClientTransportPlugin)");
@ -4654,13 +4640,12 @@ parse_bridge_line(const char *line, int validate_only,
} }
if (!validate_only) { if (!validate_only) {
log_debug(LD_DIR, "Bridge at %s:%d with transport %s (%s)", log_debug(LD_DIR, "Bridge at %s:%d (transport: %s) (%s)",
fmt_addr(&addr), (int)port, transport_name, fmt_addr(&addr), (int)port,
fingerprint ? fingerprint : "no key listed"); transport_name ? transport_name : "no transport",
fingerprint ? fingerprint : "no key listed");
if (bridge_add_from_config(&addr, port, bridge_add_from_config(&addr, port,
fingerprint ? digest : NULL,transport_name) < 0) fingerprint ? digest : NULL,transport_name);
goto err;
} }
r = 0; r = 0;