From 9e9b110032b767969e50b48bf292741ff21c6436 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Wed, 5 Mar 2025 12:52:17 +0100 Subject: [PATCH] MINOR: log: use __send_log() with exact payload length Historically, __send_log() was called with terminating NULL byte after the message payload. But now that __send_log() supports being called without terminating NULL byte (thanks to size hint), and that __sendlog() actually stips any \n or NULL byte, we don't need to bother with that anymore. So let's remove extra logic around __send_log() users where we added 1 extra byte for the terminating NULL byte. No change of behavior should be expected. --- src/log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/log.c b/src/log.c index 6be7fd222..4557c181d 100644 --- a/src/log.c +++ b/src/log.c @@ -5229,7 +5229,7 @@ void do_log(struct session *sess, struct stream *s, struct log_orig origin) ctx.sess = sess; ctx.stream = s; __send_log(&ctx, &sess->fe->loggers, &sess->fe->log_tag, level, - logline, size + 1, logline_rfc5424, sd_size); + logline, size, logline_rfc5424, sd_size); } } @@ -5288,7 +5288,7 @@ void strm_log(struct stream *s, struct log_orig origin) ctx.sess = sess; ctx.stream = s; __send_log(&ctx, &sess->fe->loggers, &sess->fe->log_tag, level, - logline, size + 1, logline_rfc5424, sd_size); + logline, size, logline_rfc5424, sd_size); s->logs.logwait = 0; } } @@ -5358,7 +5358,7 @@ void _sess_log(struct session *sess, int embryonic) ctx.stream = NULL; __send_log(&ctx, &sess->fe->loggers, &sess->fe->log_tag, level, - logline, size + 1, logline_rfc5424, sd_size); + logline, size, logline_rfc5424, sd_size); } }