aboutsummaryrefslogtreecommitdiff
path: root/src/feature/client/transports.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-12-08 10:01:23 -0500
committerAlexander Færøy <ahf@torproject.org>2020-12-16 20:37:57 +0000
commitee6ad0e592c9b6239066697ae8aff83136edc2ed (patch)
tree0f5bdf6971eefbb498f66b47676132046601d675 /src/feature/client/transports.c
parentc618c4f27986825df2026fb22b8ee222edd1afa1 (diff)
downloadtor-ee6ad0e592c9b6239066697ae8aff83136edc2ed.tar.gz
tor-ee6ad0e592c9b6239066697ae8aff83136edc2ed.zip
config: Catch missing Bridge for ClientTransportPlugin
When making sure we have a Bridge line with a ClientTransportPlugin, we now check in the managed proxy list and so we can catch any missing ClientTransportPlugin for a Bridge line. Fixes #40106 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/client/transports.c')
-rw-r--r--src/feature/client/transports.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index d1c807189a..4b05d55494 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -368,6 +368,28 @@ static int unconfigured_proxies_n = 0;
/** Boolean: True iff we might need to restart some proxies. */
static int check_if_restarts_needed = 0;
+/** Return true iff we have a managed_proxy_t in the global list is for the
+ * given transport name. */
+bool
+managed_proxy_has_transport(const char *transport_name)
+{
+ tor_assert(transport_name);
+
+ if (!managed_proxy_list) {
+ return false;
+ }
+
+ SMARTLIST_FOREACH_BEGIN(managed_proxy_list, const managed_proxy_t *, mp) {
+ SMARTLIST_FOREACH_BEGIN(mp->transports_to_launch, const char *, name) {
+ if (!strcasecmp(name, transport_name)) {
+ return true;
+ }
+ } SMARTLIST_FOREACH_END(name);
+ } SMARTLIST_FOREACH_END(mp);
+
+ return false;
+}
+
/** Return true if there are still unconfigured managed proxies, or proxies
* that need restarting. */
int