aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/milter.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-19 11:42:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-22 10:57:29 +0100
commit0334b8e433a45513c0087dda20f22a26b2e16ad1 (patch)
tree767ec1825742c1ad4a4a41c64ee846c54be40eae /src/libserver/milter.c
parenta3a8b32851bd236333af1353dad0d663f30a555d (diff)
downloadrspamd-0334b8e433a45513c0087dda20f22a26b2e16ad1.tar.gz
rspamd-0334b8e433a45513c0087dda20f22a26b2e16ad1.zip
[Project] Further rework
Diffstat (limited to 'src/libserver/milter.c')
-rw-r--r--src/libserver/milter.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c
index bb27d2ff1..897938df0 100644
--- a/src/libserver/milter.c
+++ b/src/libserver/milter.c
@@ -186,10 +186,7 @@ rspamd_milter_session_dtor (struct rspamd_milter_session *session)
priv = session->priv;
msg_debug_milter ("destroying milter session");
- if (rspamd_event_pending (&priv->ev, EV_TIMEOUT|EV_WRITE|EV_READ)) {
- event_del (&priv->ev);
- }
-
+ rspamd_ev_watcher_stop (priv->event_loop, &priv->ev);
rspamd_milter_session_reset (session, RSPAMD_MILTER_RESET_ALL);
if (priv->parser.buf) {
@@ -267,14 +264,7 @@ static inline void
rspamd_milter_plan_io (struct rspamd_milter_session *session,
struct rspamd_milter_private *priv, gshort what)
{
- if (rspamd_event_pending (&priv->ev, EV_TIMEOUT|EV_WRITE|EV_READ)) {
- event_del (&priv->ev);
- }
-
- event_set (&priv->ev, priv->fd, what, rspamd_milter_io_handler,
- session);
- event_base_set (priv->event_loop, &priv->ev);
- event_add (&priv->ev, priv->ptv);
+ rspamd_ev_watcher_reschedule (priv->event_loop, &priv->ev, what);
}