From 4e573cb8f6289b5868f6e0f537aa0ab8d0a33e46 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 8677043478..fa460e5a27 100644 --- a/src/log/log-connection.c +++ b/src/log/log-connection.c @@ -246,9 +246,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; } @@ -360,8 +358,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; -- 2.47.3