From 1607d6a6c1de9ee24aa7bf2d6d57a571f53facce Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 26 Mar 2020 16:03:38 +0100 Subject: [PATCH] Fix websocket to glib IO condition mapping --- libs/surfaces/websockets/server.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libs/surfaces/websockets/server.cc b/libs/surfaces/websockets/server.cc index b040f806d6..beab8fb254 100644 --- a/libs/surfaces/websockets/server.cc +++ b/libs/surfaces/websockets/server.cc @@ -327,14 +327,16 @@ WebsocketsServer::io_handler (Glib::IOCondition ioc, lws_sockfd_type fd) IOCondition WebsocketsServer::events_to_ioc (int events) { - IOCondition ioc; + IOCondition ioc = Glib::IOCondition (0); if (events & LWS_POLLIN) { - ioc = Glib::IO_IN; - } else if (events & LWS_POLLOUT) { - ioc = Glib::IO_OUT; - } else if (events & LWS_POLLHUP) { - ioc = Glib::IO_HUP; + ioc |= Glib::IO_IN; + } + if (events & LWS_POLLOUT) { + ioc |= Glib::IO_OUT; + } + if (events & LWS_POLLHUP) { + ioc |= Glib::IO_HUP; } return ioc;