aboutsummaryrefslogtreecommitdiff
path: root/cfg.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2013-11-14 07:51:26 +0000
committerThomas Adam <thomas@xteddy.org>2013-11-14 07:51:26 +0000
commit3e498cdb49c4ef9fcc5a4bf742407768561e795a (patch)
treec43b53acc192c8ed11f0d067e064d1873b296ce2 /cfg.c
parent2c08a3a55922651b2d5100ba5778cce74da906b2 (diff)
parent7624800ddc8fa8e51164dc7c615894c086deabef (diff)
downloadrtmux-3e498cdb49c4ef9fcc5a4bf742407768561e795a.tar.gz
rtmux-3e498cdb49c4ef9fcc5a4bf742407768561e795a.tar.bz2
rtmux-3e498cdb49c4ef9fcc5a4bf742407768561e795a.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cfg.c')
-rw-r--r--cfg.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/cfg.c b/cfg.c
index 1153de67..bfcdaea4 100644
--- a/cfg.c
+++ b/cfg.c
@@ -31,6 +31,7 @@ struct cmd_q *cfg_cmd_q;
int cfg_finished;
int cfg_references;
struct causelist cfg_causes;
+struct client *cfg_client;
int
load_cfg(const char *path, struct cmd_q *cmdq, char **cause)
@@ -127,6 +128,20 @@ cfg_default_done(unused struct cmd_q *cmdq)
cmdq_free(cfg_cmd_q);
cfg_cmd_q = NULL;
+
+ if (cfg_client != NULL) {
+ /*
+ * The client command queue starts with client_exit set to 1 so
+ * only continue if not empty (that is, we have been delayed
+ * during configuration parsing for long enough that the
+ * MSG_COMMAND has arrived), else the client will exit before
+ * the MSG_COMMAND which might tell it not to.
+ */
+ if (!TAILQ_EMPTY(&cfg_client->cmdq->queue))
+ cmdq_continue(cfg_client->cmdq);
+ cfg_client->references--;
+ cfg_client = NULL;
+ }
}
void