struct rspamd_async_event {
const gchar *subsystem;
- const gchar *loc;
+ const gchar *event_source;
event_finalizer_t fin;
void *user_data;
};
event_finalizer_t fin,
gpointer user_data,
const gchar *subsystem,
- const gchar *loc)
+ const gchar *event_source)
{
struct rspamd_async_event *new_event;
gint ret;
new_event->fin = fin;
new_event->user_data = user_data;
new_event->subsystem = subsystem;
- new_event->loc = loc;
+ new_event->event_source = event_source;
msg_debug_session ("added event: %p, pending %d (+1) events, "
"subsystem: %s (%s)",
user_data,
kh_size (session->events),
subsystem,
- loc);
+ event_source);
kh_put (rspamd_events_hash, session->events, new_event, &ret);
g_assert (ret > 0);
rspamd_session_remove_event_full (struct rspamd_async_session *session,
event_finalizer_t fin,
void *ud,
- const gchar *loc)
+ const gchar *event_source)
{
struct rspamd_async_event search_ev, *found_ev;
khiter_t k;
if (k == kh_end (session->events)) {
gchar t;
- msg_err_session ("cannot find event: %p(%p) from %s", fin, ud, loc);
+ msg_err_session ("cannot find event: %p(%p) from %s", fin, ud, event_source);
kh_foreach (session->events, found_ev, t, {
msg_err_session ("existing event %s (%s): %p(%p)",
found_ev->subsystem,
- found_ev->loc,
+ found_ev->event_source,
found_ev->fin,
found_ev->user_data);
});
ud,
kh_size (session->events),
found_ev->subsystem,
- loc,
- found_ev->loc);
+ event_source,
+ found_ev->event_source);
kh_del (rspamd_events_hash, session->events, k);
/* Remove event */
msg_info_session ("forced removed event on destroy: %p, subsystem: %s, scheduled from: %s",
ev->user_data,
ev->subsystem,
- ev->loc);
+ ev->event_source);
}
else {
msg_debug_session("removed event on destroy: %p, subsystem: %s",
"%p, subsystem: %s, scheduled from: %s",
ev->user_data,
ev->subsystem,
- ev->loc);
+ ev->event_source);
}
else {
msg_debug_session("NOT removed event on destroy - uncancellable: %p, subsystem: %s",
event_finalizer_t fin,
gpointer user_data,
const gchar *subsystem,
- const gchar *loc);
+ const gchar *event_source);
#define rspamd_session_add_event(session, fin, user_data, subsystem) \
rspamd_session_add_event_full(session, fin, user_data, subsystem, G_STRLOC)
void rspamd_session_remove_event_full (struct rspamd_async_session *session,
event_finalizer_t fin,
gpointer ud,
- const gchar *loc);
+ const gchar *event_source);
#define rspamd_session_remove_event(session, fin, user_data) \
rspamd_session_remove_event_full(session, fin, user_data, G_STRLOC)