aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_http.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-13 12:45:50 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-13 12:45:50 +0100
commit2a415e2c1d2ed0ecc790593e430dba1cb1c865df (patch)
tree47354d4952c0891405e2ed5d3b07ca2126408ee5 /src/lua/lua_http.c
parentd8837eff359da457a5573edc9fdad5d04a41ad12 (diff)
downloadrspamd-2a415e2c1d2ed0ecc790593e430dba1cb1c865df.tar.gz
rspamd-2a415e2c1d2ed0ecc790593e430dba1cb1c865df.zip
[Fix] Fix watchers in lua_tcp
Diffstat (limited to 'src/lua/lua_http.c')
-rw-r--r--src/lua/lua_http.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c
index 4471b01ce..96872108c 100644
--- a/src/lua/lua_http.c
+++ b/src/lua/lua_http.c
@@ -897,6 +897,10 @@ lua_http_request (lua_State *L)
lua_http_maybe_free (cbd);
lua_pushboolean (L, FALSE);
+ if (cbd->w) {
+ rspamd_session_watcher_pop (cbd->session, cbd->w);
+ }
+
return 1;
}
}
@@ -912,9 +916,14 @@ lua_http_request (lua_State *L)
lua_pushboolean (L, FALSE);
g_free (to_resolve);
+ if (cbd->w) {
+ rspamd_session_watcher_pop (cbd->session, cbd->w);
+ }
+
return 1;
}
+
g_free (to_resolve);
}
else {
@@ -925,6 +934,10 @@ lua_http_request (lua_State *L)
lua_http_maybe_free (cbd);
lua_pushboolean (L, FALSE);
+ if (cbd->w) {
+ rspamd_session_watcher_pop (cbd->session, cbd->w);
+ }
+
return 1;
}
}
@@ -932,11 +945,14 @@ lua_http_request (lua_State *L)
if (cbd->cbref == -1) {
cbd->thread = lua_thread_pool_get_running_entry (cfg->lua_thread_pool);
+
return lua_thread_yield (cbd->thread, 0);
- } else {
+ }
+ else {
lua_pushboolean (L, TRUE);
- return 1;
}
+
+ return 1;
}
static gint