[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Thu Jan 21 08:04:45 PST 2016
loolwsd/LOOLWSD.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit d310d3f3f562b4e0ebc7a4873e5296e59c727804
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Thu Jan 21 09:04:16 2016 -0500
loolwsd: proper ping handling by echoing
Change-Id: Ifc66ae1bc15d588d4613d87ab0fa19ec389b7615
Reviewed-on: https://gerrit.libreoffice.org/21682
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 78d53fd..2c3384c 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -216,11 +216,13 @@ void SocketProcessor(std::shared_ptr<WebSocket> ws,
if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING)
{
- ws->sendFrame("PONG", 4);
+ // Echo back the ping payload as pong.
+ ws->sendFrame(buffer, n, WebSocket::FRAME_OP_PONG);
continue;
}
else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG)
{
+ // In case we do send pings in the future.
continue;
}
else if (n <= 0)
More information about the Libreoffice-commits
mailing list