mirror of
https://github.com/holub/mame
synced 2025-10-07 09:25:34 +03:00
fix compile with DEBUG=1 (nw)
This commit is contained in:
parent
72088cfa11
commit
3bc1cf0740
@ -132,7 +132,7 @@ void *web_engine::websocket_keepalive()
|
|||||||
static void websocket_ready_handler_static(struct mg_connection *conn)
|
static void websocket_ready_handler_static(struct mg_connection *conn)
|
||||||
{
|
{
|
||||||
const struct mg_request_info *request_info = mg_get_request_info(conn);
|
const struct mg_request_info *request_info = mg_get_request_info(conn);
|
||||||
web_engine *engine = downcast<web_engine *>(request_info->user_data);
|
web_engine *engine = static_cast<web_engine *>(request_info->user_data);
|
||||||
engine->websocket_ready_handler(conn);
|
engine->websocket_ready_handler(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,20 +140,20 @@ static int websocket_data_handler_static(struct mg_connection *conn, int flags,
|
|||||||
char *data, size_t data_len)
|
char *data, size_t data_len)
|
||||||
{
|
{
|
||||||
const struct mg_request_info *request_info = mg_get_request_info(conn);
|
const struct mg_request_info *request_info = mg_get_request_info(conn);
|
||||||
web_engine *engine = downcast<web_engine *>(request_info->user_data);
|
web_engine *engine = static_cast<web_engine *>(request_info->user_data);
|
||||||
return engine->websocket_data_handler(conn, flags, data, data_len);
|
return engine->websocket_data_handler(conn, flags, data, data_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int begin_request_handler_static(struct mg_connection *conn)
|
static int begin_request_handler_static(struct mg_connection *conn)
|
||||||
{
|
{
|
||||||
const struct mg_request_info *request_info = mg_get_request_info(conn);
|
const struct mg_request_info *request_info = mg_get_request_info(conn);
|
||||||
web_engine *engine = downcast<web_engine *>(request_info->user_data);
|
web_engine *engine = static_cast<web_engine *>(request_info->user_data);
|
||||||
return engine->begin_request_handler(conn);
|
return engine->begin_request_handler(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *websocket_keepalive_static(void *thread_func_param)
|
static void *websocket_keepalive_static(void *thread_func_param)
|
||||||
{
|
{
|
||||||
web_engine *engine = downcast<web_engine *>(thread_func_param);
|
web_engine *engine = static_cast<web_engine *>(thread_func_param);
|
||||||
return engine->websocket_keepalive();
|
return engine->websocket_keepalive();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,6 +225,7 @@ void web_engine::push_message(const char *message)
|
|||||||
{
|
{
|
||||||
for (simple_list_wrapper<mg_connection> *curitem = m_websockets.first(); curitem != NULL; curitem = curitem->next())
|
for (simple_list_wrapper<mg_connection> *curitem = m_websockets.first(); curitem != NULL; curitem = curitem->next())
|
||||||
{
|
{
|
||||||
mg_websocket_write(curitem->object(), WEBSOCKET_OPCODE_TEXT, message, strlen(message));
|
int status = mg_websocket_write(curitem->object(), WEBSOCKET_OPCODE_TEXT, message, strlen(message));
|
||||||
|
if (status==0) m_websockets.remove(*curitem); // remove inactive clients
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user