This should make the kicking much faster, which is important when director
is moving thousands of users.
as in global_alt_usernames. If some field doesn't exist, it's "".
Can also be NULL if there are no user_* fields. */
const char **alt_usernames;
+ /* director_username_hash cached, if non-zero */
+ unsigned int director_username_hash_cache;
+
unsigned int destroyed:1;
unsigned int input_blocked:1;
unsigned int login_success:1;
static unsigned int director_username_hash(struct client *client)
{
- return mail_user_hash(client->virtual_user,
- client->set->director_username_hash);
+ if (client->director_username_hash_cache != 0) {
+ /* already set */
+ } else {
+ client->director_username_hash_cache =
+ mail_user_hash(client->virtual_user,
+ client->set->director_username_hash);
+ }
+ return client->director_username_hash_cache;
}
static void