From c79e59bc324f8a9278cf555ae5a6e3ce3f211d7e Mon Sep 17 00:00:00 2001 From: Mikhail Galanin Date: Mon, 10 Sep 2018 14:09:22 +0100 Subject: [PATCH] [Minor] There is no need to refer task for thread pool/lua_state: it is sometimes missing --- src/lua/lua_tcp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index 5f67607bb..3bd1ffad2 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -395,7 +395,7 @@ lua_tcp_shift_handler (struct lua_tcp_cbdata *cbd) if (hdl->type == LUA_WANT_READ) { if (hdl->h.r.cbref && hdl->h.r.cbref != -1) { - luaL_unref (cbd->task->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.r.cbref); + luaL_unref (cbd->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.r.cbref); } if (hdl->h.r.stop_pattern) { @@ -404,7 +404,7 @@ lua_tcp_shift_handler (struct lua_tcp_cbdata *cbd) } else if (hdl->type == LUA_WANT_WRITE) { if (hdl->h.w.cbref && hdl->h.w.cbref != -1) { - luaL_unref (cbd->task->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.w.cbref); + luaL_unref (cbd->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.w.cbref); } if (hdl->h.w.iov) { @@ -439,7 +439,7 @@ lua_tcp_fin (gpointer arg) msg_debug_tcp ("finishing TCP %s connection", IS_SYNC (cbd) ? "sync" : "async"); if (cbd->connect_cb != -1) { - luaL_unref (cbd->task->cfg->lua_state, LUA_REGISTRYINDEX, cbd->connect_cb); + luaL_unref (cbd->cfg->lua_state, LUA_REGISTRYINDEX, cbd->connect_cb); } if (cbd->fd != -1) { @@ -600,7 +600,7 @@ lua_tcp_push_data (struct lua_tcp_cbdata *cbd, const guint8 *str, gsize len) return; } - lua_thread_pool_prepare_callback (cbd->task->cfg->lua_thread_pool, &cbs); + lua_thread_pool_prepare_callback (cbd->cfg->lua_thread_pool, &cbs); L = cbs.L; hdl = g_queue_peek_head (cbd->handlers); @@ -992,7 +992,7 @@ lua_tcp_handler (int fd, short what, gpointer ud) cbd->flags |= LUA_TCP_FLAG_CONNECTED; if (cbd->connect_cb != -1) { - lua_thread_pool_prepare_callback (cbd->task->cfg->lua_thread_pool, &cbs); + lua_thread_pool_prepare_callback (cbd->cfg->lua_thread_pool, &cbs); L = cbs.L; struct lua_tcp_cbdata **pcbd; -- 2.39.5