]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fix using failure_context.log_prefix with internal log process communication
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 17 Dec 2017 18:39:39 +0000 (20:39 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 18 Dec 2017 11:12:11 +0000 (13:12 +0200)
src/lib/failures.c

index eb9966312c7ff166dcd6591e934db222b05bb242..f8c17c17051809a8e5a3837d43aa149f075e1e12 100644 (file)
@@ -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);