summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fastd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/fastd.c b/src/fastd.c
index d9e78b5..a226203 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -618,18 +618,19 @@ static void maintain_peer(fastd_context_t *ctx, fastd_peer_t *peer) {
}
}
-static void maintenance(fastd_context_t *ctx) {
- fastd_peer_t *peer, *next;
-
+static void enable_temporaries(fastd_context_t *ctx) {
while (ctx->peers_temp) {
- peer = ctx->peers_temp;
+ fastd_peer_t *peer = ctx->peers_temp;
ctx->peers_temp = ctx->peers_temp->next;
fastd_peer_enable_temporary(ctx, peer);
}
+}
+static void maintenance(fastd_context_t *ctx) {
fastd_socket_handle_binds(ctx);
+ fastd_peer_t *peer, *next;
for (peer = ctx->peers; peer; peer = next) {
next = peer->next;
maintain_peer(ctx, peer);
@@ -971,6 +972,8 @@ int main(int argc, char *argv[]) {
handle_input(&ctx);
+ enable_temporaries(&ctx);
+
if (fastd_timed_out(&ctx, &ctx.next_maintenance))
maintenance(&ctx);