winbind: Slightly simplify remove_timed_out_clients
authorVolker Lendecke <vl@samba.org>
Thu, 9 Mar 2017 16:50:01 +0000 (17:50 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 11 Apr 2017 23:41:14 +0000 (01:41 +0200)
Best reviewed with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/winbindd.c

index 3c16366597b64464ceeeaa80d768c9f5e170cdc3..58e4d89e4af59050b9702759335552e7aaef8775 100644 (file)
@@ -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);
        }
 }