Skip to content

Commit

Permalink
fix: const cast pair.first access for mg_websocket_write
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Nov 10, 2024
1 parent 7f7d4d8 commit 80f1212
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/viewer/src/RemoteServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 80f1212

Please sign in to comment.