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/options.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/options.c') diff --git a/src/options.c b/src/options.c index e3cf78a..1e7764d 100644 --- a/src/options.c +++ b/src/options.c @@ -117,14 +117,12 @@ static void option_config(const char *arg) { /** Handles the --config-peer option */ static void option_config_peer(const char *arg) { - fastd_peer_config_t *peer = fastd_peer_config_new(conf.peer_group); + fastd_peer_t *peer = fastd_new0(fastd_peer_t); if(!fastd_config_read(arg, conf.peer_group, peer, 0)) exit(1); - peer->next = ctx.peer_configs; - ctx.peer_configs = peer; - + fastd_peer_add(peer); } /** Handles the --config-peer-dir option */ -- cgit v1.2.3