From 3b05ef24a941f6476b58141c28f29df6a0900baf Mon Sep 17 00:00:00 2001
From: Timotej S <6674623+underhood@users.noreply.github.com>
Date: Wed, 4 Oct 2023 11:46:29 +0200
Subject: [PATCH] dont strip newlines when forwarding FUNCTION_PAYLOAD (#16120)

dont strip newlines when forwarding function payload
---
 streaming/sender.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/streaming/sender.c b/streaming/sender.c
index 6318464b9a..c37b158b11 100644
--- a/streaming/sender.c
+++ b/streaming/sender.c
@@ -956,6 +956,8 @@ void execute_commands(struct sender_state *s) {
         *newline = '\0';
 
         if (s->receiving_function_payload && unlikely(strcmp(start, PLUGINSD_KEYWORD_FUNCTION_PAYLOAD_END) != 0)) {
+            if (buffer_strlen(s->function_payload.payload) != 0)
+                buffer_strcat(s->function_payload.payload, "\n");
             buffer_strcat(s->function_payload.payload, start);
             start = newline + 1;
             continue;