Whitespace changes.

This commit is contained in:
Linus Nordberg 2011-11-29 11:00:43 +01:00 committed by Nick Mathewson
parent 39ec781b8f
commit 32d10bdfb3
4 changed files with 13 additions and 12 deletions

View File

@ -4858,7 +4858,7 @@ get_configured_bridge_by_routerinfo(const routerinfo_t *ri)
router_get_pref_orport(ri, &ap); router_get_pref_orport(ri, &ap);
return get_configured_bridge_by_addr_port_digest(&ap.addr, ap.port, return get_configured_bridge_by_addr_port_digest(&ap.addr, ap.port,
ri->cache_info.identity_digest); ri->cache_info.identity_digest);
} }
/** Return 1 if <b>ri</b> is one of our known bridges, else 0. */ /** Return 1 if <b>ri</b> is one of our known bridges, else 0. */
@ -4872,7 +4872,7 @@ routerinfo_is_a_configured_bridge(const routerinfo_t *ri)
int int
node_is_a_configured_bridge(const node_t *node) node_is_a_configured_bridge(const node_t *node)
{ {
int retval = 0; /* Negative. */ int retval = 0; /* Negative. */
smartlist_t *orports = NULL; smartlist_t *orports = NULL;
if (!node) if (!node)
@ -4884,13 +4884,13 @@ node_is_a_configured_bridge(const node_t *node)
SMARTLIST_FOREACH_BEGIN(orports, tor_addr_port_t *, orport) { SMARTLIST_FOREACH_BEGIN(orports, tor_addr_port_t *, orport) {
if (get_configured_bridge_by_addr_port_digest(&orport->addr, orport->port, if (get_configured_bridge_by_addr_port_digest(&orport->addr, orport->port,
node->identity) != NULL) { node->identity) != NULL) {
retval = 1; retval = 1;
goto out; goto out;
} }
} SMARTLIST_FOREACH_END(orport); } SMARTLIST_FOREACH_END(orport);
out: out:
if (orports != NULL) { if (orports != NULL) {
SMARTLIST_FOREACH(orports, tor_addr_port_t *, p, tor_free(p)); SMARTLIST_FOREACH(orports, tor_addr_port_t *, p, tor_free(p));
smartlist_free(orports); smartlist_free(orports);

View File

@ -5918,11 +5918,11 @@ get_first_advertised_port_by_type_af(int listener_type, int address_family)
if (cfg->type == listener_type && if (cfg->type == listener_type &&
!cfg->no_advertise && !cfg->no_advertise &&
(tor_addr_family(&cfg->addr) == address_family || (tor_addr_family(&cfg->addr) == address_family ||
tor_addr_family(&cfg->addr) == AF_UNSPEC)) { tor_addr_family(&cfg->addr) == AF_UNSPEC)) {
if (tor_addr_family(&cfg->addr) != AF_UNSPEC || if (tor_addr_family(&cfg->addr) != AF_UNSPEC ||
(address_family == AF_INET && !cfg->ipv6_only) || (address_family == AF_INET && !cfg->ipv6_only) ||
(address_family == AF_INET6 && !cfg->ipv4_only)) { (address_family == AF_INET6 && !cfg->ipv4_only)) {
return cfg->port; return cfg->port;
} }
} }
} SMARTLIST_FOREACH_END(cfg); } SMARTLIST_FOREACH_END(cfg);

View File

@ -65,7 +65,8 @@ int did_last_state_file_write_fail(void);
int or_state_save(time_t now); int or_state_save(time_t now);
const smartlist_t *get_configured_ports(void); const smartlist_t *get_configured_ports(void);
int get_first_advertised_port_by_type_af(int listener_type, int address_family); int get_first_advertised_port_by_type_af(int listener_type,
int address_family);
#define get_primary_or_port() \ #define get_primary_or_port() \
(get_first_advertised_port_by_type_af(CONN_TYPE_OR_LISTENER, AF_INET)) (get_first_advertised_port_by_type_af(CONN_TYPE_OR_LISTENER, AF_INET))
#define get_primary_dir_port() \ #define get_primary_dir_port() \

View File

@ -2121,7 +2121,6 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
return (int)written+1; return (int)written+1;
} }
/** Copy the primary (IPv4) OR port (IP address and TCP port) for /** Copy the primary (IPv4) OR port (IP address and TCP port) for
* <b>router</b> into *<b>ap_out</b>. */ * <b>router</b> into *<b>ap_out</b>. */
void void
@ -2143,7 +2142,7 @@ int
router_ipv6_preferred(const routerinfo_t *router) router_ipv6_preferred(const routerinfo_t *router)
{ {
return (!tor_addr_is_null(&router->ipv6_addr) return (!tor_addr_is_null(&router->ipv6_addr)
&& (router->ipv6_preferred || router->addr == 0)); && (router->ipv6_preferred || router->addr == 0));
} }
/** Copy the preferred OR port (IP address and TCP port) for /** Copy the preferred OR port (IP address and TCP port) for
@ -2160,7 +2159,8 @@ router_get_pref_orport(const routerinfo_t *router, tor_addr_port_t *ap_out)
/** Copy the preferred IPv6 OR port (IP address and TCP port) for /** Copy the preferred IPv6 OR port (IP address and TCP port) for
* <b>router</b> into *<b>ap_out</b>. */ * <b>router</b> into *<b>ap_out</b>. */
void void
router_get_pref_ipv6_orport(const routerinfo_t *router, tor_addr_port_t *ap_out) router_get_pref_ipv6_orport(const routerinfo_t *router,
tor_addr_port_t *ap_out)
{ {
tor_assert(ap_out != NULL); tor_assert(ap_out != NULL);
tor_addr_copy(&ap_out->addr, &router->ipv6_addr); tor_addr_copy(&ap_out->addr, &router->ipv6_addr);