aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_tcp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-05-05 14:26:20 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-05-05 14:26:20 +0100
commitdedb8506630e0de3f384d19c781993dedd73a2d5 (patch)
tree4855da0433bd019a03c727ad53175bd77745d228 /src/lua/lua_tcp.c
parenta4c9f20fa7f30124253bbcc807eaec9cce65ee48 (diff)
downloadrspamd-dedb8506630e0de3f384d19c781993dedd73a2d5.tar.gz
rspamd-dedb8506630e0de3f384d19c781993dedd73a2d5.zip
[Feature] Use rspamd specific type checks for userdata
Diffstat (limited to 'src/lua/lua_tcp.c')
-rw-r--r--src/lua/lua_tcp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c
index ad093cbe4..e6ccd85ee 100644
--- a/src/lua/lua_tcp.c
+++ b/src/lua/lua_tcp.c
@@ -486,7 +486,7 @@ lua_tcp_request (lua_State *L)
if (task == NULL) {
lua_pushstring (L, "ev_base");
lua_gettable (L, -2);
- if (luaL_checkudata (L, -1, "rspamd{ev_base}")) {
+ if (rspamd_lua_check_udata (L, -1, "rspamd{ev_base}")) {
ev_base = *(struct event_base **)lua_touserdata (L, -1);
}
else {
@@ -496,7 +496,7 @@ lua_tcp_request (lua_State *L)
lua_pushstring (L, "pool");
lua_gettable (L, -2);
- if (luaL_checkudata (L, -1, "rspamd{mempool}")) {
+ if (rspamd_lua_check_udata (L, -1, "rspamd{mempool}")) {
pool = *(rspamd_mempool_t **)lua_touserdata (L, -1);
}
else {
@@ -506,7 +506,7 @@ lua_tcp_request (lua_State *L)
lua_pushstring (L, "resolver");
lua_gettable (L, -2);
- if (luaL_checkudata (L, -1, "rspamd{resolver}")) {
+ if (rspamd_lua_check_udata (L, -1, "rspamd{resolver}")) {
resolver = *(struct rspamd_dns_resolver **)lua_touserdata (L, -1);
}
else {
@@ -516,7 +516,7 @@ lua_tcp_request (lua_State *L)
lua_pushstring (L, "session");
lua_gettable (L, -2);
- if (luaL_checkudata (L, -1, "rspamd{session}")) {
+ if (rspamd_lua_check_udata (L, -1, "rspamd{session}")) {
session = *(struct rspamd_async_session **)lua_touserdata (L, -1);
}
else {