diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-04-21 13:39:39 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-04-21 13:39:39 +0100 |
commit | 5f25b69c03972b0adff6bc649e1922111d0ebb2b (patch) | |
tree | 62fb361ba8eab64f59a1874e5d045d404727ae4e /src/lua/lua_redis.c | |
parent | bc997b7b94a36103a3d409d0de422a71df0a19d6 (diff) | |
download | rspamd-5f25b69c03972b0adff6bc649e1922111d0ebb2b.tar.gz rspamd-5f25b69c03972b0adff6bc649e1922111d0ebb2b.zip |
Refactor worker task structure and API.
Diffstat (limited to 'src/lua/lua_redis.c')
-rw-r--r-- | src/lua/lua_redis.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c index 33caefad3..2642daf9a 100644 --- a/src/lua/lua_redis.c +++ b/src/lua/lua_redis.c @@ -53,7 +53,7 @@ static const struct luaL_reg redislib_m[] = { struct lua_redis_userdata { redisAsyncContext *ctx; lua_State *L; - struct worker_task *task; + struct rspamd_task *task; gint cbref; gchar *server; struct in_addr ina; @@ -68,12 +68,12 @@ struct lua_redis_userdata { * @param L lua stack * @return worker task object */ -static struct worker_task * +static struct rspamd_task * lua_check_task (lua_State * L) { void *ud = luaL_checkudata (L, 1, "rspamd{task}"); luaL_argcheck (L, ud != NULL, 1, "'task' expected"); - return ud ? *((struct worker_task **)ud) : NULL; + return ud ? *((struct rspamd_task **)ud) : NULL; } static void @@ -95,11 +95,11 @@ lua_redis_fin (void *arg) static void lua_redis_push_error (const gchar *err, struct lua_redis_userdata *ud, gboolean connected) { - struct worker_task **ptask; + struct rspamd_task **ptask; /* Push error */ lua_rawgeti (ud->L, LUA_REGISTRYINDEX, ud->cbref); - ptask = lua_newuserdata (ud->L, sizeof (struct worker_task *)); + ptask = lua_newuserdata (ud->L, sizeof (struct rspamd_task *)); lua_setclass (ud->L, "rspamd{task}", -1); *ptask = ud->task; @@ -125,11 +125,11 @@ lua_redis_push_error (const gchar *err, struct lua_redis_userdata *ud, gboolean static void lua_redis_push_data (const redisReply *r, struct lua_redis_userdata *ud) { - struct worker_task **ptask; + struct rspamd_task **ptask; /* Push error */ lua_rawgeti (ud->L, LUA_REGISTRYINDEX, ud->cbref); - ptask = lua_newuserdata (ud->L, sizeof (struct worker_task *)); + ptask = lua_newuserdata (ud->L, sizeof (struct rspamd_task *)); lua_setclass (ud->L, "rspamd{task}", -1); *ptask = ud->task; @@ -271,7 +271,7 @@ lua_redis_dns_callback (struct rdns_reply *reply, gpointer arg) static int lua_redis_make_request (lua_State *L) { - struct worker_task *task; + struct rspamd_task *task; struct lua_redis_userdata *ud; const gchar *server, *tmp; guint port, i; |