From 7945648a49c0b3621161e77f5e3c2105ba95f6a5 Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Thu, 27 Jun 2024 13:16:00 -0700 Subject: [PATCH] Merged with main --- examples/C/src/lib/WebSocketServerString.lf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/C/src/lib/WebSocketServerString.lf b/examples/C/src/lib/WebSocketServerString.lf index cd0c55f3..3e72a827 100644 --- a/examples/C/src/lib/WebSocketServerString.lf +++ b/examples/C/src/lib/WebSocketServerString.lf @@ -74,14 +74,14 @@ reactor WebSocketServerString(hostport: int = 8080, initial_file: string = {= NU if (in_dynamic->is_present) { message_copy = (char*)malloc(strlen(in_dynamic->value)); strcpy(message_copy, in_dynamic->value); + to_send->length = strlen(in_dynamic->value); } else { message_copy = (char*)malloc(strlen(in_static->value)); strcpy(message_copy, in_static->value); + to_send->length = strlen(in_static->value); } to_send->message = message_copy; - to_send->length = strlen(in_dynamic->value); to_send->wsi = self->ws.wsi; - lf_set(server.send, to_send); } else { // Web socket is not connected.