Skip to content

Commit bdb3cad

Browse files
committed
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.
1 parent cb728a8 commit bdb3cad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/netlog/netlog-protocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ int format_rfc5424(Manager *m,
163163
/* Last Optional newline message separator, if not implicitly terminated by end of UDP frame
164164
* De facto standard: separate messages by a newline
165165
*/
166-
if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP)
166+
if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP || m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TLS)
167167
IOVEC_SET_STRING(iov[n++], "\n");
168168

169169
return protocol_send(m, iov, n);
@@ -232,7 +232,7 @@ int format_rfc3339(Manager *m,
232232
/* Last Optional newline message separator, if not implicitly terminated by end of UDP frame
233233
* De facto standard: separate messages by a newline
234234
*/
235-
if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP)
235+
if (m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TCP || m->protocol == SYSLOG_TRANSMISSION_PROTOCOL_TLS)
236236
IOVEC_SET_STRING(iov[n++], "\n");
237237

238238
return protocol_send(m, iov, n);

0 commit comments

Comments
 (0)