mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Whitespace changes.
This commit is contained in:
parent
39ec781b8f
commit
32d10bdfb3
@ -4858,7 +4858,7 @@ get_configured_bridge_by_routerinfo(const routerinfo_t *ri)
|
||||
|
||||
router_get_pref_orport(ri, &ap);
|
||||
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. */
|
||||
@ -4872,7 +4872,7 @@ routerinfo_is_a_configured_bridge(const routerinfo_t *ri)
|
||||
int
|
||||
node_is_a_configured_bridge(const node_t *node)
|
||||
{
|
||||
int retval = 0; /* Negative. */
|
||||
int retval = 0; /* Negative. */
|
||||
smartlist_t *orports = NULL;
|
||||
|
||||
if (!node)
|
||||
@ -4884,13 +4884,13 @@ node_is_a_configured_bridge(const node_t *node)
|
||||
|
||||
SMARTLIST_FOREACH_BEGIN(orports, tor_addr_port_t *, orport) {
|
||||
if (get_configured_bridge_by_addr_port_digest(&orport->addr, orport->port,
|
||||
node->identity) != NULL) {
|
||||
node->identity) != NULL) {
|
||||
retval = 1;
|
||||
goto out;
|
||||
}
|
||||
} SMARTLIST_FOREACH_END(orport);
|
||||
|
||||
out:
|
||||
out:
|
||||
if (orports != NULL) {
|
||||
SMARTLIST_FOREACH(orports, tor_addr_port_t *, p, tor_free(p));
|
||||
smartlist_free(orports);
|
||||
|
@ -5918,11 +5918,11 @@ get_first_advertised_port_by_type_af(int listener_type, int address_family)
|
||||
if (cfg->type == listener_type &&
|
||||
!cfg->no_advertise &&
|
||||
(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 ||
|
||||
(address_family == AF_INET && !cfg->ipv6_only) ||
|
||||
(address_family == AF_INET6 && !cfg->ipv4_only)) {
|
||||
return cfg->port;
|
||||
(address_family == AF_INET && !cfg->ipv6_only) ||
|
||||
(address_family == AF_INET6 && !cfg->ipv4_only)) {
|
||||
return cfg->port;
|
||||
}
|
||||
}
|
||||
} SMARTLIST_FOREACH_END(cfg);
|
||||
|
@ -65,7 +65,8 @@ int did_last_state_file_write_fail(void);
|
||||
int or_state_save(time_t now);
|
||||
|
||||
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() \
|
||||
(get_first_advertised_port_by_type_af(CONN_TYPE_OR_LISTENER, AF_INET))
|
||||
#define get_primary_dir_port() \
|
||||
|
@ -2121,7 +2121,6 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
|
||||
return (int)written+1;
|
||||
}
|
||||
|
||||
|
||||
/** Copy the primary (IPv4) OR port (IP address and TCP port) for
|
||||
* <b>router</b> into *<b>ap_out</b>. */
|
||||
void
|
||||
@ -2143,7 +2142,7 @@ int
|
||||
router_ipv6_preferred(const routerinfo_t *router)
|
||||
{
|
||||
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
|
||||
@ -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
|
||||
* <b>router</b> into *<b>ap_out</b>. */
|
||||
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_addr_copy(&ap_out->addr, &router->ipv6_addr);
|
||||
|
Loading…
Reference in New Issue
Block a user