From a04bcf247f4be7e3da4fe3895200f0b9709fc0bb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 24 Aug 2014 01:00:45 +0200 Subject: Merge peer config into peer structure With this refactoring, the structure fastd_peer_config_t is merged into fastd_peer_t, and fastd_remote_config_t into fastd_remote_t. This also means we now create peers directly when reading their configurations, which significantly simplifies the whole reload process, and prepares for some future optimizations like a key hash table. Note: This commit is too big, but I couldn't come up with a nice way to split it into smaller pieces... --- src/resolve.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/resolve.c') diff --git a/src/resolve.c b/src/resolve.c index df48fec..048c1b3 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -121,7 +121,7 @@ void fastd_resolve_peer(fastd_peer_t *peer, fastd_remote_t *remote) { return; } - pr_verbose("resolving host `%s' for peer %P...", remote->config->hostname, peer); + pr_verbose("resolving host `%s' for peer %P...", remote->hostname, peer); remote->last_resolve_timeout = fastd_in_seconds(MIN_RESOLVE_INTERVAL); @@ -129,8 +129,8 @@ void fastd_resolve_peer(fastd_peer_t *peer, fastd_remote_t *remote) { arg->peer_id = peer->id; arg->remote = remote - VECTOR_DATA(peer->remotes); - arg->hostname = fastd_strdup(remote->config->hostname); - arg->constraints = remote->config->address; + arg->hostname = fastd_strdup(remote->hostname); + arg->constraints = remote->address; pthread_t thread; if ((errno = pthread_create(&thread, &ctx.detached_thread, resolve_peer, arg)) != 0) { -- cgit v1.2.3