diff options
Diffstat (limited to 'ot_accesslist.c')
| -rw-r--r-- | ot_accesslist.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ot_accesslist.c b/ot_accesslist.c index 4bf1701..e8e0476 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c | |||
| @@ -93,7 +93,7 @@ static ot_accesslist *accesslist_make(ot_accesslist *next, size_t size) { | |||
| 93 | This will never delete head, because that might still be in use. */ | 93 | This will never delete head, because that might still be in use. */ |
| 94 | static void accesslist_clean(ot_accesslist *accesslist) { | 94 | static void accesslist_clean(ot_accesslist *accesslist) { |
| 95 | while (accesslist && accesslist->next) { | 95 | while (accesslist && accesslist->next) { |
| 96 | if (accesslist->next->base + 5 < g_now_minutes) | 96 | if (accesslist->next->base + 5 < time_now_minutes()) |
| 97 | accesslist->next = accesslist_free(accesslist->next); | 97 | accesslist->next = accesslist_free(accesslist->next); |
| 98 | accesslist = accesslist->next; | 98 | accesslist = accesslist->next; |
| 99 | } | 99 | } |
| @@ -197,7 +197,7 @@ static void accesslist_readfile(void) { | |||
| 197 | 197 | ||
| 198 | /* Mark old accesslist as "needs to live another five minutes" */ | 198 | /* Mark old accesslist as "needs to live another five minutes" */ |
| 199 | if (g_accesslist) | 199 | if (g_accesslist) |
| 200 | g_accesslist->base = g_now_minutes; | 200 | g_accesslist->base = time_now_minutes(); |
| 201 | accesslist_new->next = g_accesslist; | 201 | accesslist_new->next = g_accesslist; |
| 202 | g_accesslist = accesslist_new; /* Only now set a new list */ | 202 | g_accesslist = accesslist_new; /* Only now set a new list */ |
| 203 | 203 | ||
| @@ -205,11 +205,11 @@ static void accesslist_readfile(void) { | |||
| 205 | /* If we have dynamic accesslists, reloading a new one will always void the add/delete lists. | 205 | /* If we have dynamic accesslists, reloading a new one will always void the add/delete lists. |
| 206 | Insert empty ones at the list head */ | 206 | Insert empty ones at the list head */ |
| 207 | if (g_accesslist_add && (accesslist_new = accesslist_make(g_accesslist_add, 0)) != NULL) { | 207 | if (g_accesslist_add && (accesslist_new = accesslist_make(g_accesslist_add, 0)) != NULL) { |
| 208 | g_accesslist_add->base = g_now_minutes; | 208 | g_accesslist_add->base = time_now_minutes(); |
| 209 | g_accesslist_add = accesslist_new; | 209 | g_accesslist_add = accesslist_new; |
| 210 | } | 210 | } |
| 211 | if (g_accesslist_delete && (accesslist_new = accesslist_make(g_accesslist_delete, 0)) != NULL) { | 211 | if (g_accesslist_delete && (accesslist_new = accesslist_make(g_accesslist_delete, 0)) != NULL) { |
| 212 | g_accesslist_delete->base = g_now_minutes; | 212 | g_accesslist_delete->base = time_now_minutes(); |
| 213 | g_accesslist_delete = accesslist_new; | 213 | g_accesslist_delete = accesslist_new; |
| 214 | } | 214 | } |
| 215 | #endif | 215 | #endif |
| @@ -326,7 +326,7 @@ static void *accesslist_adddel_worker(const char *fifoname, ot_accesslist *_ | |||
| 326 | if (accesslist_new) { | 326 | if (accesslist_new) { |
| 327 | memcpy(accesslist_new->list, (*removing_from)->list, sizeof(ot_hash) * off); | 327 | memcpy(accesslist_new->list, (*removing_from)->list, sizeof(ot_hash) * off); |
| 328 | memcpy(accesslist_new->list + off, (*removing_from)->list + off + 1, sizeof(ot_hash) * ((*removing_from)->size - off - 1)); | 328 | memcpy(accesslist_new->list + off, (*removing_from)->list + off + 1, sizeof(ot_hash) * ((*removing_from)->size - off - 1)); |
| 329 | (*removing_from)->base = g_now_minutes; | 329 | (*removing_from)->base = time_now_minutes(); |
| 330 | *removing_from = accesslist_new; | 330 | *removing_from = accesslist_new; |
| 331 | } | 331 | } |
| 332 | } | 332 | } |
| @@ -351,7 +351,7 @@ static void *accesslist_adddel_worker(const char *fifoname, ot_accesslist *_ | |||
| 351 | memcpy(accesslist_new->list, (*adding_to)->list, sizeof(ot_hash) * off); | 351 | memcpy(accesslist_new->list, (*adding_to)->list, sizeof(ot_hash) * off); |
| 352 | memcpy(accesslist_new->list + off, info_hash, sizeof(info_hash)); | 352 | memcpy(accesslist_new->list + off, info_hash, sizeof(info_hash)); |
| 353 | memcpy(accesslist_new->list + off + 1, (*adding_to)->list + off, sizeof(ot_hash) * ((*adding_to)->size - off)); | 353 | memcpy(accesslist_new->list + off + 1, (*adding_to)->list + off, sizeof(ot_hash) * ((*adding_to)->size - off)); |
| 354 | (*adding_to)->base = g_now_minutes; | 354 | (*adding_to)->base = time_now_minutes(); |
| 355 | *adding_to = accesslist_new; | 355 | *adding_to = accesslist_new; |
| 356 | } | 356 | } |
| 357 | } | 357 | } |
