From a46e9a5cbb8fc233a0ccb47708e7686c2b561ac0 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Thu, 3 Jul 2025 21:37:46 +0200 Subject: Only save config when there are worthy changes --- src/query.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/query.c') diff --git a/src/query.c b/src/query.c index 2276ac1..a8643f1 100644 --- a/src/query.c +++ b/src/query.c @@ -9,7 +9,7 @@ #include #include -int handle_request(struct nodeid* self, struct tokens *tokens, time_t now, const char* method, const struct sockaddr* src, socklen_t src_len, const char* packet, size_t packet_len, char** response, size_t response_len) { +int handle_request(struct nodeid* self, struct tokens* tokens, bool *dirtyconf, time_t now, const char* method, const struct sockaddr* src, socklen_t src_len, const char* packet, size_t packet_len, char** response, size_t response_len) { if(method == NULL) { return QUERY_EBADQ; } @@ -472,6 +472,7 @@ int handle_request(struct nodeid* self, struct tokens *tokens, time_t now, const src_addr.port = htons(port); } int rc = add_peer(&infohash, &src_addr, now); + *dirtyconf = true; if(rc == PEER_EFULL) { } else if(rc != 0) { fatal("Could not add peer (%d)", rc); -- cgit v1.2.3