diff options
author | nicm <nicm> | 2019-06-07 20:09:17 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-06-07 20:09:17 +0000 |
commit | e37f34facc05c3ba146d4158cc7af23f6886fecd (patch) | |
tree | d5136e2303a92820ab6b5d532d96c8ac1b53b6db /server-client.c | |
parent | 8f40796f05f2db0ff8b2c9231054b62b511a7ba0 (diff) | |
download | rtmux-e37f34facc05c3ba146d4158cc7af23f6886fecd.tar.gz rtmux-e37f34facc05c3ba146d4158cc7af23f6886fecd.tar.bz2 rtmux-e37f34facc05c3ba146d4158cc7af23f6886fecd.zip |
Do not load the config file if the server is exiting because it failed
to start, otherwise commands like lsk which start the server again can
end up looping infinitely. Also make the first client exit
correctly. Problem reported by Wael M Nasreddine.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server-client.c b/server-client.c index 52842e38..fa21fa79 100644 --- a/server-client.c +++ b/server-client.c @@ -1511,7 +1511,9 @@ server_client_click_timer(__unused int fd, __unused short events, void *data) static void server_client_check_exit(struct client *c) { - if (!(c->flags & CLIENT_EXIT)) + if (~c->flags & CLIENT_EXIT) + return; + if (c->flags & CLIENT_EXITED) return; if (EVBUFFER_LENGTH(c->stdin_data) != 0) @@ -1524,7 +1526,7 @@ server_client_check_exit(struct client *c) if (c->flags & CLIENT_ATTACHED) notify_client("client-detached", c); proc_send(c->peer, MSG_EXIT, -1, &c->retval, sizeof c->retval); - c->flags &= ~CLIENT_EXIT; + c->flags |= CLIENT_EXITED; } /* Redraw timer callback. */ |