[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-0' - wsd/LOOLWebSocket.hpp
Tor Lillqvist
tml at collabora.com
Wed Jan 18 14:10:04 UTC 2017
wsd/LOOLWebSocket.hpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 305b64195b3438f699de443e236ddd7479658e70
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Jan 18 16:04:03 2017 +0200
Avoid misleading logging
If Poco::Net::WebSocket::receiveFrame() returns 0 or -1, flags is
likely meaningless.
diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp
index 35074c6..86dc659 100644
--- a/wsd/LOOLWebSocket.hpp
+++ b/wsd/LOOLWebSocket.hpp
@@ -109,7 +109,14 @@ public:
while (poll(waitTime, Poco::Net::Socket::SELECT_READ))
{
const int n = Poco::Net::WebSocket::receiveFrame(buffer, length, flags);
- LOG_TRC("Got frame: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, n, flags));
+ if (n <= 0)
+ {
+ LOG_TRC("Got nothing (" << n << ")");
+ }
+ else
+ {
+ LOG_TRC("Got frame: " << LOOLProtocol::getAbbreviatedFrameDump(buffer, n, flags));
+ }
if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING)
{
sendFrame(buffer, n, WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PONG);
More information about the Libreoffice-commits
mailing list