libreoffice-online/net
Ashod Nakashian ed3b1902b7 wsd: invoke handlePoll on all sockets
Before ed5569da30
we invoked handlePoll on all sockets in
each poll. But that's not true anymore.

Since i = _pollStartIndex; (line 432),
when we assigned previ = i; (line 451)
we made previ == _pollStartIndex, which
immediately broke the loop
while (previ != _pollStartIndex)
at line 438, causing handlePoll to be
called on one socket at a time (and
likely *not* the socket that had an event).

It's inefficient to poll and ignore the
result.

Now we do handle revents on multiple
sockets correctly and efficiently for
each ppoll() by going through all sockets
and handling based on whatever revents
gave us. We need to invoke the handler
of each socket to handle timeouts (i.e.
if we don't call the handler until
the socket gets an revent, we wouldn't
be able to support timeouts properly).

Notice that we still start at
a different socket each time (although
it's not entirely clear what advantage
that has, it's maintained all the same)
as the aforementioned patch does.

Change-Id: I9c0a482792aee7df5d44f4b63f173e574db36f97
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-19 18:31:50 +03:00
..
Buffer.hpp Buffer: remove _size member and calculate it from _offset as needed. 2021-11-30 09:32:45 +00:00
clientnb.cpp
DelaySocket.cpp
DelaySocket.hpp
FakeSocket.cpp
FakeSocket.hpp
HttpHelper.cpp rename: remaining lool->cool changes 2021-11-18 14:14:11 +01:00
HttpHelper.hpp
HttpRequest.cpp
HttpRequest.hpp wsd: http: do not assert on net::connect returning nullptr 2022-07-03 18:03:35 -04:00
NetUtil.cpp
NetUtil.hpp
ServerSocket.hpp wsd: make socket FD log prefix implicit and cleanup logs 2022-06-07 09:09:00 +01:00
Socket.cpp wsd: invoke handlePoll on all sockets 2022-07-19 18:31:50 +03:00
Socket.hpp wsd: cosmetics and assertion 2022-06-07 09:09:00 +01:00
Ssl.cpp wsd: use the default DH parameters in SSL 2022-04-22 09:47:19 +02:00
Ssl.hpp
SslSocket.hpp wsd: make socket FD log prefix implicit and cleanup logs 2022-06-07 09:09:00 +01:00
WebSocketHandler.hpp wsd: test: filterSendMessage -> filterSendWebSocketMessage 2022-06-27 14:07:08 +01:00
WebSocketSession.hpp rename: remaining lool->cool changes 2021-11-18 14:14:11 +01:00