From 960a0f0a994ba23480e14ffe5179160194fd9616 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 5 Aug 2008 20:08:19 +0000 Subject: r17641@31-33-44: nickm | 2008-08-05 16:07:53 -0400 Initial conversion of uint32_t addr to tor_addr_t addr in connection_t and related types. Most of the Tor wire formats using these new types are in, but the code to generate and use it is not. This is a big patch. Let me know what it breaks for you. svn:r16435 --- src/or/networkstatus.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/or/networkstatus.c') diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 1c685b64c7..35b65cf106 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1002,15 +1002,18 @@ update_v2_networkstatus_cache_downloads(time_t now) if (authority) { /* An authority launches a separate connection for everybody. */ - SMARTLIST_FOREACH(trusted_dir_servers, trusted_dir_server_t *, ds, - { + SMARTLIST_FOREACH_BEGIN(trusted_dir_servers, trusted_dir_server_t *, ds) + { char resource[HEX_DIGEST_LEN+6]; /* fp/hexdigit.z\0 */ + tor_addr_t addr; if (!(ds->type & V2_AUTHORITY)) continue; if (router_digest_is_me(ds->digest)) continue; + tor_addr_from_ipv4h(&addr, ds->addr); + /* Is this quite sensible with IPv6 or multiple addresses? */ if (connection_get_by_type_addr_port_purpose( - CONN_TYPE_DIR, ds->addr, ds->dir_port, + CONN_TYPE_DIR, &addr, ds->dir_port, DIR_PURPOSE_FETCH_NETWORKSTATUS)) { /* XXX020 the above dir_port won't be accurate if we're * doing a tunneled conn. In that case it should be or_port. @@ -1031,7 +1034,8 @@ update_v2_networkstatus_cache_downloads(time_t now) resource, NULL, 0 /* No payload. */, 0 /* No I-M-S. */); - }); + } + SMARTLIST_FOREACH_END(ds); } else { /* A non-authority cache launches one connection to a random authority. */ /* (Check whether we're currently fetching network-status objects.) */ -- cgit v1.2.3-54-g00ecf