diff options
-rw-r--r-- | main.c | 1 | ||||
-rw-r--r-- | rcon.c | 1 | ||||
-rw-r--r-- | server-proxy.c | 4 | ||||
-rw-r--r-- | server.h | 10 | ||||
-rw-r--r-- | systemd.c | 2 |
5 files changed, 12 insertions, 6 deletions
@@ -465,6 +465,7 @@ cfg_init(int argc, char **argv) if (!debug_category_str[i].name) usage(argc, argv, true); + debug_mask |= DBG_VERBOSE; debug_mask |= debug_category_str[i].val; break; @@ -333,6 +333,7 @@ rcon_free(struct uring_task *task) assert_return(task); debug(DBG_RCON, "task %p, idle %p", task, rcon); + rcon->server->rcon = NULL; xfree(rcon); } diff --git a/server-proxy.c b/server-proxy.c index 60f4b33..2e8bbd5 100644 --- a/server-proxy.c +++ b/server-proxy.c @@ -381,6 +381,10 @@ proxy_new(struct server *server, struct saddr *client, int fd) uring_task_set_buf(&proxy->servertask, &proxy->serverbuf); list_add(&proxy->list, &server->proxys); + if (server->state != SERVER_STATE_RUNNING) { + /* FIXME: We need to wait for the server to start */ + server_start(server); + } connect_any(&proxy->servertask, &server->remotes, &proxy->server_conn, proxy_connected_cb); @@ -2,11 +2,11 @@ #define fooserverhfoo enum server_state { - SERVER_STATE_INIT, - SERVER_STATE_CFG_OK, - SERVER_STATE_RUNNING, - SERVER_STATE_STOPPED, - SERVER_STATE_DEAD, + SERVER_STATE_INIT = 0, + SERVER_STATE_CFG_OK = 1, + SERVER_STATE_RUNNING = 2, + SERVER_STATE_STOPPED = 3, + SERVER_STATE_DEAD = 4, }; enum server_type { @@ -135,7 +135,7 @@ systemd_service_running(struct server *server) server->systemd_service, server->systemd_obj); out: - xfree(status); + free(status); sd_bus_error_free(&error); return running; } |