g_hash_table_insert (metric_res->symbols, (gpointer) symbol, s);
}
- msg_debug ("symbol %s, score %.2f, metric %s, factor: %f",
+ msg_debug_task ("symbol %s, score %.2f, metric %s, factor: %f",
symbol,
s->score,
metric->name,
struct rspamd_async_watcher {
event_watcher_t cb;
- guint remain;
gpointer ud;
+ guint remain;
+ gint id;
};
struct rspamd_async_event {
void
rspamd_session_watch_start (struct rspamd_async_session *session,
+ gint id,
event_watcher_t cb,
gpointer ud)
{
session->cur_watcher->cb = cb;
session->cur_watcher->remain = 0;
session->cur_watcher->ud = ud;
+ session->cur_watcher->id = id;
session->flags |= RSPAMD_SESSION_FLAG_WATCHING;
}
if (RSPAMD_SESSION_IS_WATCHING (session)) {
npending += session->cur_watcher->remain;
- msg_debug_session ("pending %d watchers", session->cur_watcher->remain);
+ msg_debug_session ("pending %d watchers, id: %d",
+ session->cur_watcher->remain, session->cur_watcher->id);
}
return npending;
if (RSPAMD_SESSION_IS_WATCHING (session)) {
session->cur_watcher->remain ++;
- msg_debug_session ("push session, %d events", session->cur_watcher->remain);
+ msg_debug_session ("push session, watcher: %d, %d events",
+ session->cur_watcher->id,
+ session->cur_watcher->remain);
}
}
if (w) {
w->remain ++;
+ msg_debug_session ("push specific, watcher: %d, %d events",
+ w->id,
+ w->remain);
}
}
g_assert (session != NULL);
if (w) {
- msg_debug_session ("pop session, %d events", w->remain);
+ msg_debug_session ("pop session, watcher: %d, %d events", w->id,
+ w->remain);
if (--w->remain == 0) {
w->cb (session->user_data, w->ud);
if (check) {
pending_before = rspamd_session_events_pending (task->s);
/* Watch for events appeared */
- rspamd_session_watch_start (task->s, rspamd_symbols_cache_watcher_cb,
+ rspamd_session_watch_start (task->s,
+ item->id,
+ rspamd_symbols_cache_watcher_cb,
item);
msg_debug_task ("execute %s, %d", item->symbol, item->id);
t1 = rspamd_get_ticks ();