From: Volker Lendecke Date: Thu, 9 Mar 2017 16:50:01 +0000 (+0100) Subject: winbind: Slightly simplify remove_timed_out_clients X-Git-Tag: tdb-1.3.13~129 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=e4173fbc5308aa9376a0305fc0c77a39a28d3497;p=samba.git winbind: Slightly simplify remove_timed_out_clients Best reviewed with "git show -b" Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 3c16366597b..58e4d89e4af 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1125,24 +1125,25 @@ static void remove_timed_out_clients(void) prev = winbindd_client_list_prev(state); expiry_time = state->last_access + timeout_val; - if (curr_time > expiry_time) { - if (client_is_idle(state)) { - DEBUG(5,("Idle client timed out, " - "shutting down sock %d, pid %u\n", - state->sock, - (unsigned int)state->pid)); - } else { - DEBUG(5,("Client request timed out, " - "shutting down sock %d, pid %u\n", - state->sock, - (unsigned int)state->pid)); - } - remove_client(state); - } else { + if (curr_time <= expiry_time) { /* list is sorted, previous clients in list are newer */ break; } + + if (client_is_idle(state)) { + DEBUG(5,("Idle client timed out, " + "shutting down sock %d, pid %u\n", + state->sock, + (unsigned int)state->pid)); + } else { + DEBUG(5,("Client request timed out, " + "shutting down sock %d, pid %u\n", + state->sock, + (unsigned int)state->pid)); + } + + remove_client(state); } }