summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/events.c11
-rw-r--r--src/libserver/events.h6
-rw-r--r--src/plugins/surbl.c3
3 files changed, 18 insertions, 2 deletions
diff --git a/src/libserver/events.c b/src/libserver/events.c
index b996f1559..d94149584 100644
--- a/src/libserver/events.c
+++ b/src/libserver/events.c
@@ -320,6 +320,17 @@ rspamd_session_watcher_push (struct rspamd_async_session *s)
}
void
+rspamd_session_watcher_push_specific (struct rspamd_async_session *s,
+ struct rspamd_async_watcher *w)
+{
+ g_assert (s != NULL);
+
+ if (w) {
+ w->remain ++;
+ }
+}
+
+void
rspamd_session_watcher_pop (struct rspamd_async_session *s,
struct rspamd_async_watcher *w)
{
diff --git a/src/libserver/events.h b/src/libserver/events.h
index eb5614af3..012629397 100644
--- a/src/libserver/events.h
+++ b/src/libserver/events.h
@@ -115,6 +115,12 @@ guint rspamd_session_watch_stop (struct rspamd_async_session *s);
void rspamd_session_watcher_push (struct rspamd_async_session *s);
/**
+ * Increase refcount for a specific watcher
+ */
+void rspamd_session_watcher_push_specific (struct rspamd_async_session *s,
+ struct rspamd_async_watcher *w);
+
+/**
* Remove a fake event from a watcher
* @param s
*/
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index fc7ff6989..3ee036ed9 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -1051,8 +1051,7 @@ surbl_dns_ip_callback (struct rdns_reply *reply, gpointer arg)
if (make_dns_request_task (task,
surbl_dns_callback,
param, RDNS_REQUEST_A, to_resolve->str)) {
- param->w = rspamd_session_get_watcher (task->s);
- rspamd_session_watcher_push (task->s);
+ rspamd_session_watcher_push_specific (task->s, param->w);
}
g_string_free (to_resolve, TRUE);