aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-15 19:19:40 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-15 19:19:40 +0100
commit8242c34c2510bc3bb412031329cfd274a4ca2cb1 (patch)
treeb5106816577e62a42d0760ca0852d18fb0baa914
parent04f6dc10a4f6b6b39520fd3287401e5dbfa81b4c (diff)
downloadrspamd-8242c34c2510bc3bb412031329cfd274a4ca2cb1.tar.gz
rspamd-8242c34c2510bc3bb412031329cfd274a4ca2cb1.zip
Use watching for http sessions.
-rw-r--r--src/lua/lua_http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c
index 10b108f13..71cc35f15 100644
--- a/src/lua/lua_http.c
+++ b/src/lua/lua_http.c
@@ -65,6 +65,7 @@ struct lua_http_cbdata {
lua_State *L;
struct rspamd_http_connection *conn;
struct rspamd_async_session *session;
+ struct rspamd_async_watcher *w;
struct rspamd_http_message *msg;
struct event_base *ev_base;
struct timeval tv;
@@ -123,6 +124,7 @@ lua_http_maybe_free (struct lua_http_cbdata *cbd)
{
if (cbd->session) {
rspamd_session_remove_event (cbd->session, lua_http_fin, cbd);
+ rspamd_session_watcher_pop (cbd->session, cbd->w);
}
else {
lua_http_fin (cbd);
@@ -442,6 +444,8 @@ lua_http_request (lua_State *L)
(event_finalizer_t)lua_http_fin,
cbd,
g_quark_from_static_string ("lua http"));
+ cbd->w = rspamd_session_get_watcher (session);
+ rspamd_session_watcher_push (session);
}
if (rspamd_parse_inet_address (&cbd->addr, msg->host->str)) {