[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Tue Jan 5 09:32:11 PST 2016


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

New commits:
commit 1bbc42351bf8b17a5a1355be0bc95570bf05cebd
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Jan 5 12:29:34 2016 -0500

    loolwsd: handle browser ping frames
    
    Change-Id: I6f0074a3f8945b0ffe7a435d40f72f0ef4eae4b8
    Reviewed-on: https://gerrit.libreoffice.org/21132
    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 bd7dc9f..4bee0e5 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -424,7 +424,11 @@ public:
                     {
                         n = ws->receiveFrame(buffer, sizeof(buffer), flags);
 
-                        if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG)
+                        if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING)
+                        {
+                            ws->sendFrame("", 0, WebSocket::FRAME_OP_PONG);
+                        }
+                        else if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PONG)
                         {
                             n = 1;
                         }


More information about the Libreoffice-commits mailing list