diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-02-28 18:58:36 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-10-29 01:05:56 -0400 |
commit | 6f33dffec1bfb7c33979477688189c63c1bfb538 (patch) | |
tree | 7d0eb43fc43627a82070b37d03ac4cd457ebfc45 /src/or/entrynodes.c | |
parent | 7ef2939e5a902c6159227de176622ee9388e34a4 (diff) | |
download | tor-6f33dffec1bfb7c33979477688189c63c1bfb538.tar.gz tor-6f33dffec1bfb7c33979477688189c63c1bfb538.zip |
Only launch transport proxies that provide useful transports.
Diffstat (limited to 'src/or/entrynodes.c')
-rw-r--r-- | src/or/entrynodes.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index f1af75aefb..beb855de90 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -1761,6 +1761,29 @@ bridge_resolve_conflicts(const tor_addr_t *addr, uint16_t port, } SMARTLIST_FOREACH_END(bridge); } +/** Return True if we have a bridge that uses a transport with name + * <b>transport_name</b>. */ +int +transport_is_needed(const char *transport_name) +{ + int retval; + smartlist_t *needed_transports = NULL; + + if (!bridge_list) + return 0; + + needed_transports = smartlist_new(); + + SMARTLIST_FOREACH_BEGIN(bridge_list, const bridge_info_t *, bridge) { + if (bridge->transport_name) + smartlist_add(needed_transports, bridge->transport_name); + } SMARTLIST_FOREACH_END(bridge); + + retval = smartlist_string_isin(needed_transports, transport_name); + smartlist_free(needed_transports); + return retval; +} + /** Remember a new bridge at <b>addr</b>:<b>port</b>. If <b>digest</b> * is set, it tells us the identity key too. If we already had the * bridge in our list, unmark it, and don't actually add anything new. |