diff options
Diffstat (limited to 'src/lua/lua_http.c')
-rw-r--r-- | src/lua/lua_http.c | 20 |
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 |