diff options
Diffstat (limited to 'idle.c')
-rw-r--r-- | idle.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -121,6 +121,8 @@ idle_check_handshake_complete(struct cfg *cfg, struct uring_task *task, int res) int32_t mclen; int r; + assert_task_alive_or(DBG_IDLE, task, return -EINTR); + remain = task->tbuf->len; pos = task->tbuf->buf; @@ -195,6 +197,8 @@ idle_check_handshake_reply(struct cfg *cfg, struct uring_task *task, int res) int player_count; int r; + assert_task_alive(DBG_IDLE, task); + debug(DBG_IDLE, "res: %i\n", res); if (res < 0) goto out; @@ -277,6 +281,8 @@ idle_check_handshake_sent(struct cfg *cfg, struct uring_task *task, int res) { struct idle *idle = container_of(task, struct idle, idlecheck); + assert_task_alive(DBG_IDLE, task); + debug(DBG_IDLE, "sent %i bytes\n", res); if (res < 0) { uring_task_close_fd(cfg, task); @@ -298,6 +304,8 @@ idle_check_connected_cb(struct cfg *cfg, struct connection *conn, bool connected uint16_t port; char hostname[INET6_ADDRSTRLEN]; + assert_task_alive(DBG_IDLE, &idle->idlecheck); + if (!connected) { debug(DBG_IDLE, "idle check connection to remote server (%s) failed\n", @@ -337,10 +345,7 @@ idle_cb(struct cfg *cfg, struct uring_task *task, int res) { struct idle *idle = container_of(task, struct idle, task); - if (task->dead) { - debug(DBG_IDLE, "task is dead\n"); - return; - } + assert_task_alive(DBG_IDLE, task); if (res != sizeof(idle->value)) { error("timerfd_read returned %i\n", res); |