diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-10-04 10:55:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-10-04 10:55:30 +0000 |
commit | c734789b1876151704fadc834bb163994131037c (patch) | |
tree | e27424d37903868abdcbb2e46355c188e2a17c01 /server-fn.c | |
parent | 205857b2320522c5c27cce9e98ad01972fda5e92 (diff) |
Check for already locked/suspended clients in server_lock_client rather than
its callers.
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server-fn.c b/server-fn.c index 6acca2bf..4e3e12ec 100644 --- a/server-fn.c +++ b/server-fn.c @@ -164,8 +164,6 @@ server_lock(void) c = ARRAY_ITEM(&clients, i); if (c == NULL || c->session == NULL) continue; - if (c->flags & CLIENT_SUSPENDED) - continue; server_lock_client(c); } } @@ -180,8 +178,6 @@ server_lock_session(struct session *s) c = ARRAY_ITEM(&clients, i); if (c == NULL || c->session == NULL || c->session != s) continue; - if (c->flags & CLIENT_SUSPENDED) - continue; server_lock_client(c); } } @@ -193,6 +189,9 @@ server_lock_client(struct client *c) size_t cmdlen; struct msg_lock_data lockdata; + if (c->flags & CLIENT_SUSPENDED) + return; + cmd = options_get_string(&c->session->options, "lock-command"); cmdlen = strlcpy(lockdata.cmd, cmd, sizeof lockdata.cmd); if (cmdlen >= sizeof lockdata.cmd) |