diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-09-05 19:03:41 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-09-05 19:03:41 +0000 |
commit | bb2d57dcbfb3a9e46a9f4141a595c02fa662e3fb (patch) | |
tree | 783e11d8068ee429a7f5cdd2946cdb89e69a00c4 | |
parent | 02c4760aceadfa24e5169b63e3b0019a4ede3ca7 (diff) | |
download | rtmux-bb2d57dcbfb3a9e46a9f4141a595c02fa662e3fb.tar.gz rtmux-bb2d57dcbfb3a9e46a9f4141a595c02fa662e3fb.tar.bz2 rtmux-bb2d57dcbfb3a9e46a9f4141a595c02fa662e3fb.zip |
Sync OpenBSD patchset 316:
Only redraw all clients once when the backoff timer expires rather than every
second all the time.
Reported by Simon Nicolussi.
-rw-r--r-- | server-fn.c | 7 | ||||
-rw-r--r-- | server.c | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/server-fn.c b/server-fn.c index 2390236b..9b7ba907 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.85 2009-09-03 20:54:39 tcunha Exp $ */ +/* $Id: server-fn.c,v 1.86 2009-09-05 19:03:41 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -234,8 +234,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); @@ -266,7 +266,8 @@ wrong: #endif 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); @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.179 2009-09-04 20:27:06 tcunha Exp $ */ +/* $Id: server.c,v 1.180 2009-09-05 19:03:41 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1213,11 +1213,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. */ |