diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-05-13 13:59:09 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-05-13 13:59:09 +0100 |
commit | 967e5ee83cb1e7bb17dde33686a48d27617b1e0c (patch) | |
tree | 8efb05f9d6fb1e876a1560354ea567f5241713ea /src/hs_helper.c | |
parent | 0a9d4aac126a244c0d1b8a5eb7322c78416df083 (diff) | |
download | rspamd-967e5ee83cb1e7bb17dde33686a48d27617b1e0c.tar.gz rspamd-967e5ee83cb1e7bb17dde33686a48d27617b1e0c.zip |
[Minor] Add some logging
Diffstat (limited to 'src/hs_helper.c')
-rw-r--r-- | src/hs_helper.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/hs_helper.c b/src/hs_helper.c index cba2ca230..c19293bb1 100644 --- a/src/hs_helper.c +++ b/src/hs_helper.c @@ -133,6 +133,10 @@ rspamd_hs_helper_cleanup_dir (struct hs_helper_ctx *ctx, gboolean forced) } globbuf.gl_offs = 0; + /* + * We reuse this buffer for .new patterns as well, so allocate with some + * margin + */ len = strlen (ctx->hs_dir) + 1 + sizeof ("*.hs.new") + 2; pattern = g_malloc (len); rspamd_snprintf (pattern, len, "%s%c%s", ctx->hs_dir, G_DIR_SEPARATOR, "*.hs"); @@ -147,6 +151,10 @@ rspamd_hs_helper_cleanup_dir (struct hs_helper_ctx *ctx, gboolean forced) strerror (errno)); ret = FALSE; } + else { + msg_notice ("successfully removed outdated hyperscan file: %s", + globbuf.gl_pathv[i]); + } } } } @@ -193,6 +201,18 @@ rspamd_hs_helper_cleanup_dir (struct hs_helper_ctx *ctx, gboolean forced) strerror(errno)); ret = FALSE; } + else { + msg_notice ("successfully removed outdated hyperscan temporary file: %s; " + "pid of the file creator process: %P", + globbuf.gl_pathv[i], + foreign_pid); + } + } + else { + msg_notice ("skip removal of the hyperscan temporary file: %s; " + "pid of the file creator process: %P", + globbuf.gl_pathv[i], + foreign_pid); } } } |