summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-03-08 19:22:53 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-03-08 19:22:53 +0100
commit4e9b2a8819c7062ad052cd6c549db1d0fbed001d (patch)
tree987c871f99025a46a1b702b905f006d193913572 /src/config.c
parent5c859a2408506c53f1b3a17bdc867a649f5bf933 (diff)
downloadfastd-4e9b2a8819c7062ad052cd6c549db1d0fbed001d.tar
fastd-4e9b2a8819c7062ad052cd6c549db1d0fbed001d.zip
Disable peer configs by default, enable on peer creation
This allows to remove some duplicate code, and will simplify the detection and handling of duplicate keys.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c
index abd386f..0febd15 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1000,19 +1000,17 @@ static void peer_dirs_handle_old_peers(fastd_context_t *ctx, fastd_peer_config_t
}
static void peer_dirs_handle_new_peers(fastd_context_t *ctx, fastd_peer_config_t **peers, fastd_peer_config_t *new_peers) {
- fastd_peer_config_t *peer, *next;
- for (peer = new_peers; peer; peer = next) {
- next = peer->next;
-
- ctx->conf->protocol->peer_configure(ctx, peer);
- if (peer->enabled)
- fastd_peer_add(ctx, peer);
+ fastd_peer_config_t *peer;
+ for (peer = new_peers; peer; peer = peer->next) {
+ if (peer->next)
+ continue;
peer->next = *peers;
*peers = peer;
}
}
+
void fastd_config_load_peer_dirs(fastd_context_t *ctx, fastd_config_t *conf) {
fastd_config_t temp_conf;
temp_conf.peer_group = conf->peer_group;