When a session is unattached, reset its activity timer to prevent it locking

instantly when reattached.
This commit is contained in:
Nicholas Marriott 2009-10-13 06:14:08 +00:00
parent 4dcb5040a0
commit 9294cb099f

View File

@ -1377,6 +1377,11 @@ server_lock_server(void)
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
continue;
if (s->flags & SESSION_UNATTACHED) {
s->activity = time(NULL);
continue;
}
timeout = options_get_number(&s->options, "lock-after-time");
if (timeout <= 0 || t <= s->activity + timeout)
return; /* not timed out */
@ -1400,6 +1405,11 @@ server_lock_sessions(void)
if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
continue;
if (s->flags & SESSION_UNATTACHED) {
s->activity = time(NULL);
continue;
}
timeout = options_get_number(&s->options, "lock-after-time");
if (timeout > 0 && t > s->activity + timeout) {
server_lock_session(s);