diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-11 15:38:27 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-11 15:38:48 +0100 |
commit | c9bb2fe5d30f40e910295241c2ae81cc1d1b8b8d (patch) | |
tree | 950ba4dbb5ed6296ec587ddec7477a988a535365 /src/libserver/protocol.c | |
parent | 73137f58b41251baf87355487d1891bd4d68d11c (diff) | |
download | rspamd-c9bb2fe5d30f40e910295241c2ae81cc1d1b8b8d.tar.gz rspamd-c9bb2fe5d30f40e910295241c2ae81cc1d1b8b8d.zip |
[Minor] Move some of mempool magic constants to a separate file
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r-- | src/libserver/protocol.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 1c11832a2..404e75ce4 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -23,6 +23,7 @@ #include "lua/lua_common.h" #include "unix-std.h" #include "protocol_internal.h" +#include "libserver/mempool_vars_internal.h" #include <math.h> static GQuark @@ -357,7 +358,8 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, hv_tok->begin, hv_tok->len, 0xdeadbabe); hp = rspamd_mempool_alloc (task->task_pool, sizeof (*hp)); memcpy (hp, &h, sizeof (*hp)); - rspamd_mempool_set_variable (task->task_pool, "settings_hash", + rspamd_mempool_set_variable (task->task_pool, + RSPAMD_MEMPOOL_SETTINGS_HASH, hp, NULL); } break; @@ -424,7 +426,8 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, IF_HEADER (MTA_TAG_HEADER) { gchar *mta_tag; mta_tag = rspamd_mempool_ftokdup (task->task_pool, hv_tok); - rspamd_mempool_set_variable (task->task_pool, "MTA-Tag", + rspamd_mempool_set_variable (task->task_pool, + RSPAMD_MEMPOOL_MTA_TAG, mta_tag, NULL); debug_task ("read MTA-Tag header, value: %s", mta_tag); } @@ -1068,7 +1071,7 @@ rspamd_protocol_write_ucl (struct rspamd_task *task, GString *dkim_sig; const ucl_object_t *rmilter_reply; struct rspamd_saved_protocol_reply *cached; - static const gchar *varname = "cached_reply"; + static const gchar *varname = RSPAMD_MEMPOOL_CACHED_REPLY; /* Check for cached reply */ cached = rspamd_mempool_get_variable (task->task_pool, varname); |