From: Timo Sirainen Date: Sun, 17 Dec 2017 18:39:39 +0000 (+0200) Subject: lib: Fix using failure_context.log_prefix with internal log process communication X-Git-Tag: 2.3.9~2645 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39454303866b345d010f024e86adbd2f0fa66692;p=thirdparty%2Fdovecot%2Fcore.git lib: Fix using failure_context.log_prefix with internal log process communication --- diff --git a/src/lib/failures.c b/src/lib/failures.c index eb9966312c..f8c17c1705 100644 --- a/src/lib/failures.c +++ b/src/lib/failures.c @@ -626,14 +626,19 @@ internal_handler(const struct failure_context *ctx, T_BEGIN { string_t *str; size_t prefix_len; + unsigned char log_type = ctx->type + 1; - if (!log_prefix_sent && log_prefix != NULL) { + if (ctx->log_prefix != NULL) { + log_type |= LOG_TYPE_FLAG_DISABLE_LOG_PREFIX; + } else if (!log_prefix_sent && log_prefix != NULL) { log_prefix_sent = TRUE; i_failure_send_option("prefix", log_prefix); } str = t_str_new(128); - str_printfa(str, "\001%c%s ", ctx->type + 1, my_pid); + str_printfa(str, "\001%c%s ", log_type, my_pid); + if (ctx->log_prefix != NULL) + str_append(str, ctx->log_prefix); prefix_len = str_len(str); str_vprintfa(str, format, args);