mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 00:23:08 +01:00
When a session is unattached, reset its activity timer to prevent it locking
instantly when reattached.
This commit is contained in:
parent
4dcb5040a0
commit
9294cb099f
10
server.c
10
server.c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user