Sync OpenBSD patchset 352:

Don't allow locked or suspended clients to limit the size of active clients.
pull/1/head
Tiago Cunha 2009-09-25 17:47:42 +00:00
parent b5d23ef38b
commit 804b8696a4
4 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-lock-server.c,v 1.6 2009-07-28 22:12:16 tcunha Exp $ */ /* $Id: cmd-lock-server.c,v 1.7 2009-09-25 17:47:42 tcunha Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -45,6 +45,7 @@ int
cmd_lock_server_exec(unused struct cmd *self, unused struct cmd_ctx *ctx) cmd_lock_server_exec(unused struct cmd *self, unused struct cmd_ctx *ctx)
{ {
server_lock(); server_lock();
recalculate_sizes();
return (0); return (0);
} }

View File

@ -1,4 +1,4 @@
/* $Id: resize.c,v 1.23 2009-07-20 15:42:05 tcunha Exp $ */ /* $Id: resize.c,v 1.24 2009-09-25 17:47:42 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -60,7 +60,7 @@ recalculate_sizes(void)
ssx = ssy = UINT_MAX; ssx = ssy = UINT_MAX;
for (j = 0; j < ARRAY_LENGTH(&clients); j++) { for (j = 0; j < ARRAY_LENGTH(&clients); j++) {
c = ARRAY_ITEM(&clients, j); c = ARRAY_ITEM(&clients, j);
if (c == NULL) if (c == NULL || c->flags & CLIENT_SUSPENDED)
continue; continue;
if (c->session == s) { if (c->session == s) {
if (c->tty.sx < ssx) if (c->tty.sx < ssx)

View File

@ -1,4 +1,4 @@
/* $Id: server-msg.c,v 1.89 2009-09-23 15:20:16 tcunha Exp $ */ /* $Id: server-msg.c,v 1.90 2009-09-25 17:47:42 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -103,6 +103,7 @@ server_msg_dispatch(struct client *c)
c->flags &= ~CLIENT_SUSPENDED; c->flags &= ~CLIENT_SUSPENDED;
tty_start_tty(&c->tty); tty_start_tty(&c->tty);
server_redraw_client(c); server_redraw_client(c);
recalculate_sizes();
server_activity = time(NULL); server_activity = time(NULL);
break; break;
case MSG_ENVIRON: case MSG_ENVIRON:

View File

@ -1,4 +1,4 @@
/* $Id: server.c,v 1.193 2009-09-23 15:10:37 tcunha Exp $ */ /* $Id: server.c,v 1.194 2009-09-25 17:47:42 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -1197,8 +1197,10 @@ server_second_timers(void)
t = time(NULL); t = time(NULL);
xtimeout = options_get_number(&global_s_options, "lock-after-time"); xtimeout = options_get_number(&global_s_options, "lock-after-time");
if (xtimeout > 0 && t > server_activity + xtimeout) if (xtimeout > 0 && t > server_activity + xtimeout) {
server_lock(); server_lock();
recalculate_sizes();
}
for (i = 0; i < ARRAY_LENGTH(&windows); i++) { for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
w = ARRAY_ITEM(&windows, i); w = ARRAY_ITEM(&windows, i);