]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Kill other `rmilter` occurrencies
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Jun 2017 14:46:04 +0000 (15:46 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Jun 2017 14:53:34 +0000 (15:53 +0100)
src/libserver/mempool_vars_internal.h
src/libserver/protocol.c
src/lua/lua_task.c

index f566b78af475a9efa522c121fe3b41e0a9fd98b5..94f7f8f02f6e5ee48caddbcad2e1f558aa6564f3 100644 (file)
@@ -28,7 +28,7 @@
 #define RSPAMD_MEMPOOL_SPF_DOMAIN "spf_domain"
 #define RSPAMD_MEMPOOL_PRINCIPAL_RECIPIENT "principal_recipient"
 #define RSPAMD_MEMPOOL_PROFILE "profile"
-#define RSPAMD_MEMPOOL_RMILTER_REPLY "rmilter_reply"
+#define RSPAMD_MEMPOOL_MILTER_REPLY "milter_reply"
 #define RSPAMD_MEMPOOL_DKIM_SIGNATURE "dkim-signature"
 #define RSPAMD_MEMPOOL_DMARC_CHECKS "dmarc_checks"
 #define RSPAMD_MEMPOOL_DKIM_BH_CACHE "dkim_bh_cache"
index 2bfcdd6d1d7c0e005838dfc679916637b60b88ef..99e965af1ee38a3399449b515f6b8e9c2259ec8d 100644 (file)
@@ -1077,7 +1077,7 @@ rspamd_protocol_write_ucl (struct rspamd_task *task,
 {
        ucl_object_t *top = NULL;
        GString *dkim_sig;
-       const ucl_object_t *rmilter_reply;
+       const ucl_object_t *milter_reply;
        struct rspamd_saved_protocol_reply *cached;
        static const gchar *varname = RSPAMD_MEMPOOL_CACHED_REPLY;
 
@@ -1180,16 +1180,16 @@ rspamd_protocol_write_ucl (struct rspamd_task *task,
        }
 
        if (flags & RSPAMD_PROTOCOL_RMILTER) {
-               rmilter_reply = rspamd_mempool_get_variable (task->task_pool,
-                               RSPAMD_MEMPOOL_RMILTER_REPLY);
+               milter_reply = rspamd_mempool_get_variable (task->task_pool,
+                               RSPAMD_MEMPOOL_MILTER_REPLY);
 
-               if (rmilter_reply) {
+               if (milter_reply) {
                        if (task->cmd == CMD_CHECK_V2) {
-                               ucl_object_insert_key (top, ucl_object_ref (rmilter_reply),
+                               ucl_object_insert_key (top, ucl_object_ref (milter_reply),
                                                "milter", 0, false);
                        }
                        else {
-                               ucl_object_insert_key (top, ucl_object_ref (rmilter_reply),
+                               ucl_object_insert_key (top, ucl_object_ref (milter_reply),
                                                "rmilter", 0, false);
                        }
                }
index 8445e25eda40a4a251449ab972c93734791bc26d..579eee9cc0959b9c64a65bb286315a51ec6a7b20 100644 (file)
@@ -610,17 +610,17 @@ LUA_FUNCTION_DEF (task, lookup_settings);
 LUA_FUNCTION_DEF (task, get_settings_id);
 
 /***
- * @method task:set_rmilter_reply(obj)
- * Set special reply for rmilter
+ * @method task:set_milter_reply(obj)
+ * Set special reply for milter
  * @param {any} obj any lua object that corresponds to the settings format
  * @example
-task:set_rmilter_reply({
+task:set_milter_reply({
        add_headers = {['X-Lua'] = 'test'},
        -- 1 is the position of header to remove
        remove_headers = {['DKIM-Signature'] = 1},
 })
  */
-LUA_FUNCTION_DEF (task, set_rmilter_reply);
+LUA_FUNCTION_DEF (task, set_milter_reply);
 
 /***
  * @method task:process_re(params)
@@ -765,7 +765,7 @@ LUA_FUNCTION_DEF (task, store_in_file);
  * - `metrics`: metrics and symbols
  * - `messages`: messages
  * - `dkim`: dkim signature
- * - `rmilter`: rmilter control block
+ * - `milter`: milter control block
  * - `extra`: extra data, such as profiling
  * - `urls`: list of all urls in a message
  *
@@ -870,7 +870,8 @@ static const struct luaL_reg tasklib_m[] = {
        LUA_INTERFACE_DEF (task, set_flag),
        LUA_INTERFACE_DEF (task, get_flags),
        LUA_INTERFACE_DEF (task, has_flag),
-       LUA_INTERFACE_DEF (task, set_rmilter_reply),
+       {"set_rmilter_reply", lua_task_set_milter_reply},
+       LUA_INTERFACE_DEF (task, set_milter_reply),
        LUA_INTERFACE_DEF (task, get_digest),
        LUA_INTERFACE_DEF (task, store_in_file),
        LUA_INTERFACE_DEF (task, get_protocol_reply),
@@ -3517,7 +3518,7 @@ lua_task_set_settings (lua_State *L)
 }
 
 static gint
-lua_task_set_rmilter_reply (lua_State *L)
+lua_task_set_milter_reply (lua_State *L)
 {
        struct rspamd_task *task = lua_check_task (L, 1);
        ucl_object_t *reply, *prev;
@@ -3526,7 +3527,7 @@ lua_task_set_rmilter_reply (lua_State *L)
 
        if (reply != NULL && task != NULL) {
                prev = rspamd_mempool_get_variable (task->task_pool,
-                               RSPAMD_MEMPOOL_RMILTER_REPLY);
+                               RSPAMD_MEMPOOL_MILTER_REPLY);
 
                if (prev) {
                        ucl_object_merge (prev, reply, false);
@@ -3534,7 +3535,7 @@ lua_task_set_rmilter_reply (lua_State *L)
                }
                else {
                        rspamd_mempool_set_variable (task->task_pool,
-                                       RSPAMD_MEMPOOL_RMILTER_REPLY,
+                                       RSPAMD_MEMPOOL_MILTER_REPLY,
                                        reply, (rspamd_mempool_destruct_t) ucl_object_unref);
                }
        }