diff options
author | nicm <nicm> | 2015-06-05 18:01:12 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-06-05 18:01:12 +0000 |
commit | 8c93b768e4864be330c3d6a7962892135224f0f4 (patch) | |
tree | 783a393e81cd604e69a4b4aaabbc6acafb6410d6 /server.c | |
parent | b0782df8a64f744b7c067e6f918ce5217ea09e57 (diff) | |
download | rtmux-8c93b768e4864be330c3d6a7962892135224f0f4.tar.gz rtmux-8c93b768e4864be330c3d6a7962892135224f0f4.tar.bz2 rtmux-8c93b768e4864be330c3d6a7962892135224f0f4.zip |
Instead of putting dead clients on a list and checking it every loop,
use event_once to queue a callback to deal with them. Also dead clients
with references would never actually be freed because the wrap-up
functions (the callback for stdin, or status_prompt_clear) would never
be called. So call them in server_client_lost.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 11 |
1 files changed, 0 insertions, 11 deletions
@@ -41,9 +41,7 @@ * Main server functions. */ -/* Client list. */ struct clients clients; -struct clients dead_clients; int server_fd; int server_shutdown; @@ -205,7 +203,6 @@ server_start(int lockfd, char *lockfile) RB_INIT(&windows); RB_INIT(&all_window_panes); TAILQ_INIT(&clients); - TAILQ_INIT(&dead_clients); RB_INIT(&sessions); RB_INIT(&dead_sessions); TAILQ_INIT(&session_groups); @@ -325,7 +322,6 @@ void server_clean_dead(void) { struct session *s, *s1; - struct client *c, *c1; RB_FOREACH_SAFE(s, sessions, &dead_sessions, s1) { if (s->references != 0) @@ -334,13 +330,6 @@ server_clean_dead(void) free(s->name); free(s); } - - TAILQ_FOREACH_SAFE(c, &dead_clients, entry, c1) { - if (c->references != 0) - continue; - TAILQ_REMOVE(&dead_clients, c, entry); - free(c); - } } /* Update socket execute permissions based on whether sessions are attached. */ |