/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "array.h"
#include "hash.h"
#include "llist.h"
#include "mail-host.h"
/* n% of timeout_secs */
/* This shouldn't matter what it is exactly, just try it sometimes later. */
struct user_directory_iter {
};
struct user_directory {
/* unsigned int username_hash => user */
/* sorted by time. may be unsorted while handshakes are going on. */
unsigned int timeout_secs;
/* If user's expire time is less than this many seconds away,
don't assume that other directors haven't yet expired it */
unsigned int user_near_expiring_secs;
bool sort_pending;
};
{
(*iterp)->stop_after_tail =
}
}
}
{
}
{
if (expire_timestamp > ioloop_time) {
return TRUE;
}
if (USER_IS_BEING_KILLED(user)) {
/* don't free this user until the kill is finished */
return TRUE;
}
return TRUE;
}
i_warning("User %u weakness appears to be stuck, removing it",
}
return FALSE;
}
{
expire_timestamp = 0;
}
if (expire_timestamp != 0) {
}
}
}
{
}
unsigned int username_hash)
{
}
return user;
}
struct user *
{
/* make sure we don't add timestamps higher than ioloop time */
if (timestamp > ioloop_time)
}
return user;
}
{
}
{
}
}
{
return -1;
return 1;
return 0;
}
{
if (users_count == 0) {
return;
}
/* We can't sort the directory while there are iterators
or they'll skip users. Do the sort after there are no more
iterators. */
return;
}
/* place all users into array and sort it */
/* recreate the linked list */
array_free(&users);
}
{
}
{
return expire_timestamp < ioloop_time;
}
struct user_directory *
{
return dir;
}
{
}
struct user_directory_iter *
bool iter_until_current_tail)
{
return iter;
}
{
return NULL;
/* this is the last user we want to iterate */
}
return user;
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
break;
}
}
}