aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-25 15:18:47 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-25 15:18:47 +0000
commit0599cdf4bbc8a38d159cff27195c71e27fb21000 (patch)
tree56c071c1f0a1d6b751c1be59c68bf89b673e320d
parente0b4ba6307bcb324e380b4420f1a49bcc1ef764f (diff)
downloadrspamd-0599cdf4bbc8a38d159cff27195c71e27fb21000.tar.gz
rspamd-0599cdf4bbc8a38d159cff27195c71e27fb21000.zip
Clean log buffer when forking
-rw-r--r--src/libutil/logger.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c
index 5f5d062d3..2c7ceeef7 100644
--- a/src/libutil/logger.c
+++ b/src/libutil/logger.c
@@ -386,6 +386,21 @@ rspamd_log_update_pid (GQuark ptype, rspamd_logger_t *rspamd_log)
{
rspamd_log->pid = getpid ();
rspamd_log->process_type = ptype;
+
+ /* We also need to clear all messages pending */
+ if (rspamd_log->repeats > 0) {
+ rspamd_log->repeats = 0;
+ if (rspamd_log->saved_message) {
+ g_free (rspamd_log->saved_message);
+ g_free (rspamd_log->saved_function);
+ g_free (rspamd_log->saved_module);
+ g_free (rspamd_log->saved_id);
+ rspamd_log->saved_message = NULL;
+ rspamd_log->saved_function = NULL;
+ rspamd_log->saved_module = NULL;
+ rspamd_log->saved_id = NULL;
+ }
+ }
}
/**