summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-09-05 17:42:17 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-09-05 17:42:17 +0000
commiteef0e189694ea93f1e6c2b54a5fce49faa87b2d0 (patch)
treeb9389c3f5635e773171233743b34d624660c5f27 /usr.bin/tmux
parent644d294babf3f4aaef64ba19ac7abbaf9aa101cd (diff)
Only redraw all clients once when the backoff timer expires rather than every
second all the time. Reported by Simon Nicolussi.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/server-fn.c7
-rw-r--r--usr.bin/tmux/server.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c
index 60809cf5513..2697fc070ed 100644
--- a/usr.bin/tmux/server-fn.c
+++ b/usr.bin/tmux/server-fn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-fn.c,v 1.17 2009/09/02 16:38:35 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.18 2009/09/05 17:42:16 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -233,8 +233,8 @@ server_unlock(const char *s)
return (0);
wrong:
- password_backoff = server_activity;
password_failures++;
+ password_backoff = 0;
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);
@@ -260,7 +260,8 @@ wrong:
}
failures = password_failures % tries;
if (failures > backoff) {
- password_backoff += ((failures - backoff) * tries / 2);
+ password_backoff =
+ server_activity + ((failures - backoff) * tries / 2);
return (-2);
}
return (-1);
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 6af90ed464d..400bed6431a 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.28 2009/09/04 13:29:10 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.29 2009/09/05 17:42:16 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1210,11 +1210,12 @@ server_second_timers(void)
}
}
- if (t > password_backoff) {
+ if (password_backoff != 0 && t >= password_backoff) {
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
if ((c = ARRAY_ITEM(&clients, i)) != NULL)
server_redraw_client(c);
}
+ password_backoff = 0;
}
/* Check for a minute having passed. */