From 5fc5933a627743927b36008da2a8dad5918e21aa Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 31 Aug 2018 14:57:13 +0300 Subject: [PATCH] log: Move data stack frame allocation to parent function This simplifies the next commit, which requires data stack nearly always when logging. The data stack frames are cheap enough that we don't really need to optimize for avoiding the cases when they're not needed. --- src/log/log-connection.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/log/log-connection.c b/src/log/log-connection.c index 144b46eed4..8456094859 100644 --- a/src/log/log-connection.c +++ b/src/log/log-connection.c @@ -245,9 +245,7 @@ log_it(struct log_connection *log, const char *line, const char *prefix; if (log->master) { - T_BEGIN { - log_parse_master_line(line, log_time, tm); - } T_END; + log_parse_master_line(line, log_time, tm); return; } @@ -359,8 +357,9 @@ static void log_connection_input(struct log_connection *log) now = ioloop_timeval; tm = *localtime(&now.tv_sec); - while ((line = i_stream_next_line(log->input)) != NULL) + while ((line = i_stream_next_line(log->input)) != NULL) T_BEGIN { log_it(log, line, &now, &tm); + } T_END; io_loop_time_refresh(); if (timeval_diff_msecs(&ioloop_timeval, &start_timeval) > MAX_MSECS_PER_CONNECTION) { too_much = TRUE;