diff options
author | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-15 15:30:47 +0100 |
---|---|---|
committer | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-15 15:30:47 +0100 |
commit | b29e8792c6be01be944223a0eea7ba373b151327 (patch) | |
tree | 184a9317512ff81855b03af909e90ce42504dba9 /src/libserver | |
parent | cfe8fb280d2795d5929f8b2088e9b1f141f465cd (diff) | |
parent | f01c0800f7a9caf1b2b4e9c58b044d5def09e76a (diff) | |
download | rspamd-b29e8792c6be01be944223a0eea7ba373b151327.tar.gz rspamd-b29e8792c6be01be944223a0eea7ba373b151327.zip |
Merge branch 'master' into lua-coroutine-model
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/events.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libserver/events.c b/src/libserver/events.c index f62005b96..bff35351f 100644 --- a/src/libserver/events.c +++ b/src/libserver/events.c @@ -309,14 +309,17 @@ void rspamd_session_cleanup (struct rspamd_async_session *session) { struct rspamd_async_event *ev; - gchar t; + int i; if (session == NULL) { msg_err ("session is NULL"); return; } - kh_foreach (session->events, ev, t, { + for (i = kh_begin (session->events); i != kh_end (session->events); i ++) { + if (!kh_exist (session->events, i)) continue; + ev = kh_key (session->events, i); + /* Call event's finalizer */ msg_debug_session ("removed event on destroy: %p, subsystem: %s", ev->user_data, @@ -325,9 +328,7 @@ rspamd_session_cleanup (struct rspamd_async_session *session) if (ev->fin != NULL) { ev->fin (ev->user_data); } - }); - - (void)t; + } kh_clear (rspamd_events_hash, session->events); } |