From 171dd6a58b89a5a7cdb55711515bec532a8f1bc6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 3 Apr 2012 04:23:46 +0200 Subject: Save source dirs with peer configs --- src/config.c | 1 + src/peer.c | 3 +++ src/peer.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/config.c b/src/config.c index 2cf7494..5fa1591 100644 --- a/src/config.c +++ b/src/config.c @@ -135,6 +135,7 @@ void fastd_read_config_dir(fastd_context *ctx, fastd_config *conf, const char *d fastd_peer_config_new(ctx, conf); conf->peers->name = strdup(result->d_name); + conf->peers->config_source_dir = strdup(dir); if (!fastd_read_config(ctx, conf, result->d_name, true, depth)) { pr_warn(ctx, "peer config %s will be ignored", result->d_name); diff --git a/src/peer.c b/src/peer.c index 92e6aa5..d0375ae 100644 --- a/src/peer.c +++ b/src/peer.c @@ -83,6 +83,8 @@ fastd_peer_config* fastd_peer_config_new(fastd_context *ctx, fastd_config *conf) memset(&peer->address, 0, sizeof(fastd_peer_address)); + peer->config_source_dir = NULL; + peer->name = NULL; peer->key = NULL; peer->protocol_config = NULL; @@ -96,6 +98,7 @@ fastd_peer_config* fastd_peer_config_new(fastd_context *ctx, fastd_config *conf) void fastd_peer_config_delete(fastd_context *ctx, fastd_config *conf) { fastd_peer_config *peer = conf->peers, *next = peer->next; + free(peer->config_source_dir); free(peer->name); free(peer->key); free(peer); diff --git a/src/peer.h b/src/peer.h index 54f6ca8..d3b9cfe 100644 --- a/src/peer.h +++ b/src/peer.h @@ -54,6 +54,8 @@ struct _fastd_peer { struct _fastd_peer_config { fastd_peer_config *next; + char *config_source_dir; + bool enabled; char *name; -- cgit v1.2.3