commit 4b6f074df9c540cb4847793b7e8243c8f642de0a Merge: 49278cd 2235d65 Author: Nick Mathewson nickm@torproject.org Date: Tue Oct 29 01:29:59 2013 -0400
Merge remote-tracking branch 'public/bug5018'
Conflicts: src/or/entrynodes.c
changes/bug5018 | 3 +++ src/or/config.c | 23 ++++++++++++++++++----- src/or/entrynodes.c | 17 +++++++++++++++++ src/or/entrynodes.h | 1 + 4 files changed, 39 insertions(+), 5 deletions(-)
diff --cc src/or/entrynodes.c index 59cc9a3,ca3ef53..ecc67f0 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@@ -1801,10 -1761,31 +1801,27 @@@ bridge_resolve_conflicts(const tor_addr } 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) + { + if (!bridge_list) + return 0; + + SMARTLIST_FOREACH_BEGIN(bridge_list, const bridge_info_t *, bridge) { + if (bridge->transport_name && + !strcmp(bridge->transport_name, transport_name)) + return 1; + } SMARTLIST_FOREACH_END(bridge); + + return 0; + } + -/** 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. - * If <b>transport_name</b> is non-NULL - the bridge is associated with a - * pluggable transport - we assign the transport to the bridge. */ +/** Register the bridge information in <b>bridge_line</b> to the + * bridge subsystem. Steals reference of <b>bridge_line</b>. */ void -bridge_add_from_config(const tor_addr_t *addr, uint16_t port, - const char *digest, const char *transport_name) +bridge_add_from_config(bridge_line_t *bridge_line) { bridge_info_t *b;
diff --cc src/or/entrynodes.h index 1f8cff7,b02cd48..772c666 --- a/src/or/entrynodes.h +++ b/src/or/entrynodes.h @@@ -120,9 -115,10 +120,10 @@@ void entry_guards_free_all(void) const char *find_transport_name_by_bridge_addrport(const tor_addr_t *addr, uint16_t port); struct transport_t; -int find_transport_by_bridge_addrport(const tor_addr_t *addr, uint16_t port, +int get_transport_by_bridge_addrport(const tor_addr_t *addr, uint16_t port, const struct transport_t **transport);
+ int transport_is_needed(const char *transport_name); int validate_pluggable_transports_config(void);
double pathbias_get_close_success_count(entry_guard_t *guard);