diff options
Diffstat (limited to 'ot_accesslist.c')
| -rw-r--r-- | ot_accesslist.c | 6 |
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 | ||
