Keep client list sorted by last access time, newest
to oldest.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397
Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
state->cmd_name = "unknown request";
state->recv_fn = NULL;
- state->last_access = time(NULL);
+ /* client is newest */
+ winbindd_promote_client(state);
/* Process command */
return;
}
- state->last_access = time(NULL);
-
state->privileged = privileged;
req = wb_req_read_send(state, winbind_event_context(), state->sock,
void winbindd_add_client(struct winbindd_cli_state *cli)
{
+ cli->last_access = time(NULL);
DLIST_ADD(_client_list, cli);
_num_clients++;
}
void winbindd_promote_client(struct winbindd_cli_state *cli)
{
+ cli->last_access = time(NULL);
DLIST_PROMOTE(_client_list, cli);
}