From bdb3cad2c946d4a20201ed97e2e8a2ccf758b46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Mon, 28 Jul 2025 21:04:04 +0200 Subject: [PATCH] Add terminating newline also for TLS connections TLS runs over TCP, and follows the same message formatting rules as plain TCP. Without this, the receiver might show mangled messages. --- src/netlog/netlog-protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/netlog/netlog-protocol.c b/src/netlog/netlog-protocol.c index df3a14a..9260f4c 100644 --- a/src/netlog/netlog-protocol.c +++ b/src/netlog/netlog-protocol.c @@ -163,7 +163,7 @@ int format_rfc5424(Manager *m, /* Last Optional newline message separator, if not implicitly terminated by end of UDP frame * De facto standard: separate messages by a newline */ - if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP) + if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP || m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TLS) IOVEC_SET_STRING(iov[n++], "\n"); return protocol_send(m, iov, n); @@ -232,7 +232,7 @@ int format_rfc3339(Manager *m, /* Last Optional newline message separator, if not implicitly terminated by end of UDP frame * De facto standard: separate messages by a newline */ - if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP) + if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP || m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TLS) IOVEC_SET_STRING(iov[n++], "\n"); return protocol_send(m, iov, n);