]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 7 Sep 2018 07:41:16 +0000 (10:41 +0300)
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 144b46eed44ec4070425ca2e2462b65620c645d4..84560948591eb229861a8e475bf534f717abd215 100644 (file)
@@ -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;