From: Vsevolod Stakhov Date: Fri, 2 Jun 2017 14:46:04 +0000 (+0100) Subject: [Minor] Kill other `rmilter` occurrencies X-Git-Tag: 1.6.0~73 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cee0ee2828be1c7e7791fd96401857dca0a60c94;p=rspamd.git [Minor] Kill other `rmilter` occurrencies --- diff --git a/src/libserver/mempool_vars_internal.h b/src/libserver/mempool_vars_internal.h index f566b78af..94f7f8f02 100644 --- a/src/libserver/mempool_vars_internal.h +++ b/src/libserver/mempool_vars_internal.h @@ -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" diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 2bfcdd6d1..99e965af1 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -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); } } diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 8445e25ed..579eee9cc 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -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); } }