]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Refactor argument/member name for better soundness
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Dec 2021 21:05:35 +0000 (21:05 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Dec 2021 21:05:35 +0000 (21:05 +0000)
src/libserver/async_session.c
src/libserver/async_session.h

index f84b8aa5eadedb573947964a1971b7e2a7c85bdd..2f084687ba31f6c799622017966131d9041c3268 100644 (file)
@@ -50,7 +50,7 @@ static struct rspamd_counter_data events_count;
 
 struct rspamd_async_event {
        const gchar *subsystem;
-       const gchar *loc;
+       const gchar *event_source;
        event_finalizer_t fin;
        void *user_data;
 };
@@ -151,7 +151,7 @@ rspamd_session_add_event_full (struct rspamd_async_session *session,
                                                           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;
@@ -174,14 +174,14 @@ rspamd_session_add_event_full (struct rspamd_async_session *session,
        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);
@@ -193,7 +193,7 @@ void
 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;
@@ -215,11 +215,11 @@ rspamd_session_remove_event_full (struct rspamd_async_session *session,
        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);
                });
@@ -235,8 +235,8 @@ rspamd_session_remove_event_full (struct rspamd_async_session *session,
                        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 */
@@ -289,7 +289,7 @@ rspamd_session_cleanup (struct rspamd_async_session *session, bool forced_cleanu
                                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",
@@ -304,7 +304,7 @@ rspamd_session_cleanup (struct rspamd_async_session *session, bool forced_cleanu
                                                                  "%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",
index 5dc4a3b847e2a9cd7c657f845622fea263eb0c6d..b5323b1df38735fbaf2678e058ea693a2a5f5296 100644 (file)
@@ -55,7 +55,7 @@ rspamd_session_add_event_full (struct rspamd_async_session *session,
                                                           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)
@@ -69,7 +69,7 @@ rspamd_session_add_event_full (struct rspamd_async_session *session,
 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)