fix: const cast pair.first access for mg_websocket_write (#8264)

Co-authored-by: Powei Feng <powei@google.com>
This commit is contained in:
Amin Ya
2025-02-27 14:28:04 -08:00
committed by GitHub
parent 1b2ab09719
commit ad2fdb4663

View File

@@ -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<mg_connection *>(iter.first), 0x80, label, strlen(label) + 1);
mg_websocket_write(const_cast<mg_connection *>(iter.first), 0x80, buffer, bufsize);
}
}