diff options
author | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-15 16:32:26 +0100 |
---|---|---|
committer | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-15 16:32:26 +0100 |
commit | f368a0a51e7073bdf244bf1a959fb5ccb0389b9b (patch) | |
tree | de0eee22af55c38148d6415951b1253f7b874f49 /src/libserver | |
parent | b29e8792c6be01be944223a0eea7ba373b151327 (diff) | |
parent | 938a0dba32a7f1632c3e14b92d986384aff19d7a (diff) | |
download | rspamd-f368a0a51e7073bdf244bf1a959fb5ccb0389b9b.tar.gz rspamd-f368a0a51e7073bdf244bf1a959fb5ccb0389b9b.zip |
Merge branch 'master' into lua-coroutine-model
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/events.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libserver/events.c b/src/libserver/events.c index bff35351f..c23c90328 100644 --- a/src/libserver/events.c +++ b/src/libserver/events.c @@ -309,17 +309,13 @@ void rspamd_session_cleanup (struct rspamd_async_session *session) { struct rspamd_async_event *ev; - int i; if (session == NULL) { msg_err ("session is NULL"); return; } - 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); - + kh_foreach_key (session->events, ev, { /* Call event's finalizer */ msg_debug_session ("removed event on destroy: %p, subsystem: %s", ev->user_data, @@ -328,7 +324,7 @@ rspamd_session_cleanup (struct rspamd_async_session *session) if (ev->fin != NULL) { ev->fin (ev->user_data); } - } + }); kh_clear (rspamd_events_hash, session->events); } |