loolwsd/LOOLWSD.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d310d3f3f562b4e0ebc7a4873e5296e59c727804
Author: Ashod Nakashian <[email protected]>
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 <[email protected]>
    Tested-by: Ashod Nakashian <[email protected]>

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)
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to