Skip to content

Commit

Permalink
lib: Fix using failure_context.log_prefix with internal log process c…
Browse files Browse the repository at this point in the history
…ommunication
  • Loading branch information
sirainen committed Dec 18, 2017
1 parent bf88269 commit 1a5b037
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/failures.c
Expand Up @@ -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);
Expand Down

0 comments on commit 1a5b037

Please sign in to comment.