summaryrefslogtreecommitdiff
path: root/ot_accesslist.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-24 13:23:23 +0200
committerDirk Engling <erdgeist@erdgeist.org>2026-10-24 13:23:23 +0200
commit65e3cb612368eecc31574ea77bd818b5e1db3dd5 (patch)
tree26034a21c3670c9f1e3b9e2426a908e2d2acfa20 /ot_accesslist.c
parent243a34d725873ca40b4ef514c26a4b7ae87bbe83 (diff)
Keep accesslists for five more minutes after they have been removed not after they have been created
Diffstat (limited to 'ot_accesslist.c')
-rw-r--r--ot_accesslist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ot_accesslist.c b/ot_accesslist.c
index a199fa4..86fb128 100644
--- a/ot_accesslist.c
+++ b/ot_accesslist.c
@@ -81,7 +81,7 @@ static ot_accesslist *accesslist_make(ot_accesslist *next, size_t size) {
81 if (accesslist_new) { 81 if (accesslist_new) {
82 accesslist_new->list = size ? malloc(sizeof(ot_hash) * size) : NULL; 82 accesslist_new->list = size ? malloc(sizeof(ot_hash) * size) : NULL;
83 accesslist_new->size = size; 83 accesslist_new->size = size;
84 accesslist_new->base = g_now_minutes; 84 accesslist_new->base = 0;
85 accesslist_new->next = next; 85 accesslist_new->next = next;
86 if (size && !accesslist_new->list) { 86 if (size && !accesslist_new->list) {
87 free(accesslist_new); 87 free(accesslist_new);
@@ -192,6 +192,10 @@ static void accesslist_readfile(void) {
192 192
193 /* Now exchange the accesslist vector in the least race condition prone way */ 193 /* Now exchange the accesslist vector in the least race condition prone way */
194 pthread_mutex_lock(&g_accesslist_mutex); 194 pthread_mutex_lock(&g_accesslist_mutex);
195
196 /* Mark old accesslist as "needs to live another five minutes" */
197 if (g_accesslist)
198 g_accesslist->base = g_now_minutes;
195 accesslist_new->next = g_accesslist; 199 accesslist_new->next = g_accesslist;
196 g_accesslist = accesslist_new; /* Only now set a new list */ 200 g_accesslist = accesslist_new; /* Only now set a new list */
197 201