diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-06 13:26:28 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-06 13:26:28 +0000 |
commit | 1b34354919b33ae45d65fe82efca0090b34114f2 (patch) | |
tree | a4dc1c1c4b995a3365d5d410480ad183cc3704c4 /src/libserver/cfg_utils.c | |
parent | 86cbc23ee5a3503ce6989bbce2117aad96c050f8 (diff) | |
download | rspamd-1b34354919b33ae45d65fe82efca0090b34114f2.tar.gz rspamd-1b34354919b33ae45d65fe82efca0090b34114f2.zip |
Start implementation of flexible task logging
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r-- | src/libserver/cfg_utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 161482ee2..084efffad 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -362,6 +362,7 @@ rspamd_config_process_var (struct rspamd_config *cfg, const rspamd_ftok_t *var, lf->data = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (rspamd_ftok_t)); memcpy (lf->data, &tok, sizeof (tok)); + lf->len = sizeof (tok); } } else { @@ -391,6 +392,7 @@ rspamd_config_process_var (struct rspamd_config *cfg, const rspamd_ftok_t *var, id = luaL_ref (cfg->lua_state, LUA_REGISTRYINDEX); lf->data = GINT_TO_POINTER (id); + lf->len = 0; } DL_APPEND (cfg->log_format, lf); @@ -437,6 +439,7 @@ rspamd_config_parse_log_format (struct rspamd_config *cfg) lf = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (*lf)); lf->type = RSPAMD_LOG_STRING; lf->data = rspamd_mempool_alloc (cfg->cfg_pool, p - c + 1); + lf->len = p - c; rspamd_strlcpy (lf->data, c, p - c + 1); DL_APPEND (cfg->log_format, lf); lf = NULL; @@ -498,6 +501,7 @@ rspamd_config_parse_log_format (struct rspamd_config *cfg) lf = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (*lf)); lf->type = RSPAMD_LOG_STRING; lf->data = rspamd_mempool_alloc (cfg->cfg_pool, p - c + 1); + lf->len = p - c; rspamd_strlcpy (lf->data, c, p - c + 1); DL_APPEND (cfg->log_format, lf); lf = NULL; |