diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-29 13:06:23 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-29 13:06:23 +0100 |
commit | b3713de7cefa87af9ed95d091db497cef63502d0 (patch) | |
tree | d689606317be5f22ede887fc7ae418247a3bef60 /src/libutil/libev_helper.c | |
parent | 30c0dca001842d9dc009be0ff9ade49b69963bd2 (diff) | |
download | rspamd-b3713de7cefa87af9ed95d091db497cef63502d0.tar.gz rspamd-b3713de7cefa87af9ed95d091db497cef63502d0.zip |
[Fix] Fix pending checks for events
Diffstat (limited to 'src/libutil/libev_helper.c')
-rw-r--r-- | src/libutil/libev_helper.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/libev_helper.c b/src/libutil/libev_helper.c index 81a23dea6..65a53d3f7 100644 --- a/src/libutil/libev_helper.c +++ b/src/libutil/libev_helper.c @@ -80,7 +80,7 @@ void rspamd_ev_watcher_stop (struct ev_loop *loop, struct rspamd_io_ev *ev) { - if (ev_is_pending (&ev->io) || ev_is_active (&ev->io)) { + if (ev_can_stop (&ev->io)) { ev_io_stop (EV_A_ &ev->io); } @@ -96,7 +96,7 @@ rspamd_ev_watcher_reschedule (struct ev_loop *loop, { g_assert (ev->cb != NULL); - if (ev_is_pending (&ev->io) || ev_is_active (&ev->io)) { + if (ev_can_stop (&ev->io)) { ev_io_stop (EV_A_ &ev->io); ev_io_set (&ev->io, ev->io.fd, what); ev_io_start (EV_A_ &ev->io); @@ -108,7 +108,7 @@ rspamd_ev_watcher_reschedule (struct ev_loop *loop, } if (ev->timeout > 0) { - if (!(ev_is_active (&ev->tm) || ev_is_pending (&ev->tm))) { + if (!(ev_can_stop (&ev->tm))) { ev->tm.data = ev; ev_timer_init (&ev->tm, rspamd_ev_watcher_timer_cb, ev->timeout, 0.0); ev_timer_start (EV_A_ &ev->tm); |