summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'server.c')
-rw-r--r--server.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/server.c b/server.c
index 690c0ca..d11e6a7 100644
--- a/server.c
+++ b/server.c
@@ -369,6 +369,9 @@ server_start(struct cfg *cfg, struct server *scfg)
if (!cfg || !scfg)
return false;
+ if (scfg->task.dead)
+ return false;
+
switch (scfg->start_method) {
case SERVER_START_METHOD_EXEC:
@@ -394,6 +397,9 @@ server_stop(struct cfg *cfg, struct server *scfg)
if (!cfg || !scfg)
return false;
+ if (scfg->task.dead)
+ return false;
+
switch (scfg->stop_method) {
case SERVER_STOP_METHOD_EXEC:
@@ -429,6 +435,9 @@ server_commit(struct cfg *cfg, struct server *scfg)
return false;
}
+ if (scfg->task.dead)
+ return false;
+
if (!list_empty(&scfg->proxys)) {
error("%s: proxys not empty?\n", scfg->name);
return false;
@@ -587,6 +596,9 @@ server_add_remote(struct cfg *cfg, struct server *scfg, struct saddr *remote)
if (!scfg || !remote)
return false;
+ if (scfg->task.dead)
+ return false;
+
debug(DBG_SRV, "adding remote: %s\n", remote->addrstr);
list_add(&remote->list, &scfg->remotes);
return true;
@@ -602,6 +614,9 @@ server_add_local(struct cfg *cfg, struct server *scfg, struct saddr *saddr)
return false;
}
+ if (scfg->task.dead)
+ return false;
+
local = zmalloc(sizeof(*local));
if (!local) {
error("malloc: %m");
@@ -623,6 +638,9 @@ server_add_rcon(struct cfg *cfg, struct server *scfg, struct saddr *rcon)
if (!scfg || !rcon)
return false;
+ if (scfg->task.dead)
+ return false;
+
debug(DBG_SRV, "adding rcon: %s\n", rcon->addrstr);
list_add(&rcon->list, &scfg->rcons);
return true;