diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-26 16:03:38 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-26 16:04:17 +0100 |
commit | 1607d6a6c1de9ee24aa7bf2d6d57a571f53facce (patch) | |
tree | c6fbe7436e15c7833f1f6999d70c09a9a3003286 | |
parent | 8a65c1fce228d0267458a399d3574b1023234454 (diff) |
Fix websocket to glib IO condition mapping
-rw-r--r-- | libs/surfaces/websockets/server.cc | 14 |
1 files 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; |