mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-13 15:37:27 +02:00
Merge branch 'obsd-master'
Conflicts: client.c tmux.1 tmux.c
This commit is contained in:
30
server.c
30
server.c
@ -40,9 +40,7 @@
|
||||
* Main server functions.
|
||||
*/
|
||||
|
||||
/* Client list. */
|
||||
struct clients clients;
|
||||
struct clients dead_clients;
|
||||
|
||||
int server_fd;
|
||||
int server_shutdown;
|
||||
@ -59,7 +57,6 @@ int server_create_socket(void);
|
||||
void server_loop(void);
|
||||
int server_should_shutdown(void);
|
||||
void server_send_shutdown(void);
|
||||
void server_clean_dead(void);
|
||||
void server_accept_callback(int, short, void *);
|
||||
void server_signal_callback(int, short, void *);
|
||||
void server_child_signal(void);
|
||||
@ -204,9 +201,7 @@ 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);
|
||||
mode_key_init_trees();
|
||||
key_bindings_init();
|
||||
@ -268,8 +263,6 @@ server_loop(void)
|
||||
|
||||
server_window_loop();
|
||||
server_client_loop();
|
||||
|
||||
server_clean_dead();
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,29 +314,6 @@ server_send_shutdown(void)
|
||||
session_destroy(s);
|
||||
}
|
||||
|
||||
/* Free dead, unreferenced clients and sessions. */
|
||||
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)
|
||||
continue;
|
||||
RB_REMOVE(sessions, &dead_sessions, s);
|
||||
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. */
|
||||
void
|
||||
server_update_socket(void)
|
||||
|
Reference in New Issue
Block a user