From 80f12129f75a1d7af272d8531fd5504c24a21802 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 6 Nov 2024 06:05:15 -0800 Subject: [PATCH] fix: const cast pair.first access for mg_websocket_write --- libs/viewer/src/RemoteServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/viewer/src/RemoteServer.cpp b/libs/viewer/src/RemoteServer.cpp index 441c730f78a..fb95d1ae894 100644 --- a/libs/viewer/src/RemoteServer.cpp +++ b/libs/viewer/src/RemoteServer.cpp @@ -208,8 +208,8 @@ bool MessageReceiver::handleData(CivetServer* server, struct mg_connection* conn void MessageSender::sendMessage(const char* label, const char* buffer, size_t bufsize) { for (auto iter : connections) { - mg_websocket_write(iter.first, 0x80, label, strlen(label) + 1); - mg_websocket_write(iter.first, 0x80, buffer, bufsize); + mg_websocket_write(const_cast(iter.first), 0x80, label, strlen(label) + 1); + mg_websocket_write(const_cast(iter.first), 0x80, buffer, bufsize); } }