diff options
| author | 2013-08-13 08:33:12 +0000 | |
|---|---|---|
| committer | 2013-08-13 08:33:12 +0000 | |
| commit | 3bc1cf07400797dd930155d5f787d9ce2da2a370 (patch) | |
| tree | 7cb5313e4f67a8d37a85e8191cab01f90db01d17 /src/emu/webengine.c | |
| parent | 72088cfa11046ed9e27e208b9fc4c56c1d110f8d (diff) | |
fix compile with DEBUG=1 (nw)
Diffstat (limited to 'src/emu/webengine.c')
| -rw-r--r-- | src/emu/webengine.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/emu/webengine.c b/src/emu/webengine.c index 88d4d0cf76f..bd23b2ef075 100644 --- a/src/emu/webengine.c +++ b/src/emu/webengine.c @@ -132,7 +132,7 @@ void *web_engine::websocket_keepalive() static void websocket_ready_handler_static(struct mg_connection *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); } @@ -140,20 +140,20 @@ static int websocket_data_handler_static(struct mg_connection *conn, int flags, char *data, size_t data_len) { 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); } static int begin_request_handler_static(struct mg_connection *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); } 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(); } @@ -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()) { - 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 } } |
