aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-06 13:35:14 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-06 13:35:14 +0100
commit915a460b6a425cc5694f4166c86ee8138ffd0ace (patch)
tree9bb4d5be1cdbc13522241a1035367ab58298b001 /src/libserver
parent619fdbc7b82eea8f7b4f38fa9f29c02802619727 (diff)
downloadrspamd-915a460b6a425cc5694f4166c86ee8138ffd0ace.tar.gz
rspamd-915a460b6a425cc5694f4166c86ee8138ffd0ace.zip
[Minor] Fix event pending checks
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/fuzzy_backend_redis.c2
-rw-r--r--src/libserver/milter.c4
-rw-r--r--src/libserver/monitored.c6
-rw-r--r--src/libserver/redis_pool.c2
-rw-r--r--src/libserver/task.c2
-rw-r--r--src/libserver/worker_util.c4
6 files changed, 10 insertions, 10 deletions
diff --git a/src/libserver/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend_redis.c
index 7bb442a27..5081170b6 100644
--- a/src/libserver/fuzzy_backend_redis.c
+++ b/src/libserver/fuzzy_backend_redis.c
@@ -126,7 +126,7 @@ rspamd_fuzzy_redis_session_dtor (struct rspamd_fuzzy_redis_session *session,
ac, is_fatal);
}
- if (event_get_base (&session->timeout)) {
+ if (rspamd_event_pending (&session->timeout, EV_TIMEOUT)) {
event_del (&session->timeout);
}
diff --git a/src/libserver/milter.c b/src/libserver/milter.c
index 4f6d05d6a..16d6252e9 100644
--- a/src/libserver/milter.c
+++ b/src/libserver/milter.c
@@ -185,7 +185,7 @@ rspamd_milter_session_dtor (struct rspamd_milter_session *session)
priv = session->priv;
msg_debug_milter ("destroying milter session");
- if (event_get_base (&priv->ev)) {
+ if (rspamd_event_pending (&priv->ev, EV_TIMEOUT|EV_WRITE|EV_READ)) {
event_del (&priv->ev);
}
@@ -265,7 +265,7 @@ static inline void
rspamd_milter_plan_io (struct rspamd_milter_session *session,
struct rspamd_milter_private *priv, gshort what)
{
- if (event_get_base (&priv->ev)) {
+ if (rspamd_event_pending (&priv->ev, EV_TIMEOUT|EV_WRITE|EV_READ)) {
event_del (&priv->ev);
}
diff --git a/src/libserver/monitored.c b/src/libserver/monitored.c
index 7928615f9..9adcab943 100644
--- a/src/libserver/monitored.c
+++ b/src/libserver/monitored.c
@@ -589,7 +589,7 @@ rspamd_monitored_stop (struct rspamd_monitored *m)
{
g_assert (m != NULL);
- if (event_get_base (&m->periodic)) {
+ if (rspamd_event_pending (&m->periodic, EV_TIMEOUT)) {
event_del (&m->periodic);
}
}
@@ -606,7 +606,7 @@ rspamd_monitored_start (struct rspamd_monitored *m)
0.0);
double_to_tv (jittered, &tv);
- if (event_get_base (&m->periodic)) {
+ if (rspamd_event_pending (&m->periodic, EV_TIMEOUT)) {
event_del (&m->periodic);
}
@@ -626,8 +626,8 @@ rspamd_monitored_ctx_destroy (struct rspamd_monitored_ctx *ctx)
for (i = 0; i < ctx->elts->len; i ++) {
m = g_ptr_array_index (ctx->elts, i);
rspamd_monitored_stop (m);
- g_free (m->url);
m->proc.monitored_dtor (m, m->ctx, m->proc.ud);
+ g_free (m->url);
g_free (m);
}
diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c
index 3d77aca1c..98f20ca9c 100644
--- a/src/libserver/redis_pool.c
+++ b/src/libserver/redis_pool.c
@@ -120,7 +120,7 @@ rspamd_redis_pool_conn_dtor (struct rspamd_redis_pool_connection *conn)
else {
msg_debug_rpool ("inactive connection removed");
- if (event_get_base (&conn->timeout)) {
+ if (rspamd_event_pending (&conn->timeout, EV_TIMEOUT)) {
event_del (&conn->timeout);
}
diff --git a/src/libserver/task.c b/src/libserver/task.c
index d77fc0145..0fde93f55 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -296,7 +296,7 @@ rspamd_task_free (struct rspamd_task *task)
g_error_free (task->err);
}
- if (event_get_base (&task->timeout_ev) != NULL) {
+ if (rspamd_event_pending (&task->timeout_ev, EV_TIMEOUT)) {
event_del (&task->timeout_ev);
}
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 64e0bae2e..cdd98ded5 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -359,11 +359,11 @@ rspamd_worker_stop_accept (struct rspamd_worker *worker)
while (cur) {
events = cur->data;
- if (event_get_base (&events[0])) {
+ if (rspamd_event_pending (&events[0], EV_TIMEOUT|EV_READ|EV_WRITE)) {
event_del (&events[0]);
}
- if (event_get_base (&events[1])) {
+ if (rspamd_event_pending (&events[1], EV_TIMEOUT|EV_READ|EV_WRITE)) {
event_del (&events[1]);
}