aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_tcp.c
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-08-31 09:52:56 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-08-31 09:52:56 +0100
commitbad44f28f5b25218d92619cca8e2d54559e3ec31 (patch)
tree19c61b80dd749829a4248fcbfb874db621f48c33 /src/lua/lua_tcp.c
parentc392c868b5f68c4c8b786fa2c83c00e596975c7f (diff)
parent62646da93b1d5145878f79db88b21ce8367ef99d (diff)
downloadrspamd-bad44f28f5b25218d92619cca8e2d54559e3ec31.tar.gz
rspamd-bad44f28f5b25218d92619cca8e2d54559e3ec31.zip
Merge branch 'master' into coroutines-tcp
Diffstat (limited to 'src/lua/lua_tcp.c')
-rw-r--r--src/lua/lua_tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c
index 851605be1..6b6c32773 100644
--- a/src/lua/lua_tcp.c
+++ b/src/lua/lua_tcp.c
@@ -393,7 +393,7 @@ lua_tcp_shift_handler (struct lua_tcp_cbdata *cbd)
}
if (hdl->type == LUA_WANT_READ) {
- if (hdl->h.r.cbref) {
+ if (hdl->h.r.cbref && hdl->h.r.cbref != -1) {
luaL_unref (cbd->task->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.r.cbref);
}
@@ -402,7 +402,7 @@ lua_tcp_shift_handler (struct lua_tcp_cbdata *cbd)
}
}
else if (hdl->type == LUA_WANT_WRITE) {
- if (hdl->h.w.cbref) {
+ if (hdl->h.w.cbref && hdl->h.w.cbref != -1) {
luaL_unref (cbd->task->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.w.cbref);
}