]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
log: Move data stack frame allocation to parent function
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 31 Aug 2018 11:57:13 +0000 (14:57 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 3 Sep 2018 08:46:58 +0000 (08:46 +0000)
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

index 86770434785b303b6c6a8e46a86600d73d988884..fa460e5a27d472029507cc115ac855e34ad2cebf 100644 (file)
@@ -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;