13
0

Fix websocket to glib IO condition mapping

This commit is contained in:
Robin Gareus 2020-03-26 16:03:38 +01:00
parent 8a65c1fce2
commit 1607d6a6c1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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;