]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use mempool tag instead of local one for milter
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 May 2017 21:25:16 +0000 (22:25 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 May 2017 21:25:16 +0000 (22:25 +0100)
src/libserver/milter.c
src/libserver/milter_internal.h

index 392d7198eadd1665b940571938efec23cd865ce8..d739a9d5e59e43d5aa013432c1b21884a2c93ec9 100644 (file)
 #include "utlist.h"
 
 #define msg_err_milter(...) rspamd_default_log_function(G_LOG_LEVEL_CRITICAL, \
-        "milter", priv->uid, \
+        "milter", priv->pool->tag.uid, \
         G_STRFUNC, \
         __VA_ARGS__)
 #define msg_warn_milter(...)   rspamd_default_log_function (G_LOG_LEVEL_WARNING, \
-        "milter", priv->uid, \
+        "milter", priv->pool->tag.uid, \
         G_STRFUNC, \
         __VA_ARGS__)
 #define msg_info_milter(...)   rspamd_default_log_function (G_LOG_LEVEL_INFO, \
-        "milter", priv->uid, \
+        "milter", priv->pool->tag.uid, \
         G_STRFUNC, \
         __VA_ARGS__)
 #define msg_debug_milter(...)  rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \
-        "milter", priv->uid, \
+        "milter", priv->pool->tag.uid, \
         G_STRFUNC, \
         __VA_ARGS__)
 
@@ -953,7 +953,6 @@ rspamd_milter_handle_socket (gint fd, const struct timeval *tv,
 {
        struct rspamd_milter_session *session;
        struct rspamd_milter_private *priv;
-       guchar uidbuf[7];
 
        g_assert (finish_cb != NULL);
        g_assert (error_cb != NULL);
@@ -969,10 +968,6 @@ rspamd_milter_handle_socket (gint fd, const struct timeval *tv,
        priv->ev_base = ev_base;
        priv->state = RSPAMD_MILTER_READ_MORE;
        priv->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), "milter");
-       ottery_rand_bytes (uidbuf, sizeof (uidbuf));
-       rspamd_encode_hex_buf (uidbuf, sizeof (uidbuf), priv->uid,
-                       sizeof (priv->uid) - 1);
-       priv->uid[sizeof (priv->uid) - 1] = '\0';
 
        if (tv) {
                memcpy (&priv->tv, tv, sizeof (*tv));
index 52dee2d7aee273e958c12a0f72742d73a41010f1..214add98c99445a64e8cdd1002de171b50f4d1e0 100644 (file)
@@ -62,7 +62,6 @@ struct rspamd_milter_private {
        rspamd_milter_finish fin_cb;
        rspamd_milter_error err_cb;
        void *ud;
-       guchar uid[15];
        enum rspamd_milter_io_state state;
        int fd;
 };