diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-06-10 20:46:52 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-06-10 20:46:52 +0200 |
commit | 6b139d613ae6fa127bdce1be5c634ed4b53b1efd (patch) | |
tree | fe55f6e36831ee0e2702ea085fab0e29aff8a578 /src/peer.c | |
parent | 65a09a09d6cc3e26be9488e69895154ab2ae14fd (diff) | |
download | fastd-6b139d613ae6fa127bdce1be5c634ed4b53b1efd.tar fastd-6b139d613ae6fa127bdce1be5c634ed4b53b1efd.zip |
Clean up peer config loading
Instead of changing the peer list and peer group in the main conf during
(re-)loading, add a parser state which contains this information.
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -431,13 +431,9 @@ static void delete_peer(fastd_peer_t *peer) { /** Allocates a new peer config */ -fastd_peer_config_t* fastd_peer_config_new(void) { +fastd_peer_config_t* fastd_peer_config_new(fastd_peer_group_t *group) { fastd_peer_config_t *peer = calloc(1, sizeof(fastd_peer_config_t)); - - peer->group = conf.peer_group; - - peer->next = conf.peers; - conf.peers = peer; + peer->group = group; return peer; } @@ -458,13 +454,6 @@ void fastd_peer_config_free(fastd_peer_config_t *peer) { free(peer); } -/** Deletes the peer config created last */ -void fastd_peer_config_delete(void) { - fastd_peer_config_t *peer = conf.peers, *next = peer->next; - fastd_peer_config_free(peer); - conf.peers = next; -} - /** Deletes a peer config, and removes the peer assiciated with the peer config */ void fastd_peer_config_purge(fastd_peer_config_t *config) { size_t i; |