websocket

add same check from broadcast
This commit is contained in:
2024-08-23 14:20:35 +02:00
parent 368c5b04b3
commit 511c6382db
+4
View File
@@ -105,6 +105,10 @@ void Websocket::process_messages()
{ {
std::lock_guard<std::mutex> guard(m_connection_lock); std::lock_guard<std::mutex> guard(m_connection_lock);
std::string response = m_on_message(a.msg->get_payload()); std::string response = m_on_message(a.msg->get_payload());
if (response.empty() || response == "{}")
{
continue;
}
m_server.send(a.hdl, response, websocketpp::frame::opcode::TEXT); m_server.send(a.hdl, response, websocketpp::frame::opcode::TEXT);
} }
break; break;