Function client_set_state no longer calls session_active_clients
to check whether active clients has reached zero - when the state
that is being set for the client parameter is already known to be
"active".
void client_set_state(struct client *cl, enum client_state st)
{
cl->state = st;
- if (cl->session)
+ /* no need to check for all client being non-active if this one
+ already is. Note that session_active_clients also LOCKS session */
+ if (!client_is_active(cl) && cl->session)
{
int no_active = session_active_clients(cl->session);
if (no_active == 0)