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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Sep 19 12:00:00 UTC 2016


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

New commits:
commit 258b768218a699e1ab84cf35de89b113637f23e8
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sat Sep 17 21:43:31 2016 -0400

    loolwsd: break receiveFrame on TerminationFlag
    
    Change-Id: Id6d71951660431abea1a393fc7fe91a88552fc04
    Reviewed-on: https://gerrit.libreoffice.org/29006
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/IoUtil.cpp b/loolwsd/IoUtil.cpp
index 1e5db62..bb861dd 100644
--- a/loolwsd/IoUtil.cpp
+++ b/loolwsd/IoUtil.cpp
@@ -40,7 +40,7 @@ namespace IoUtil
 
 int receiveFrame(WebSocket& socket, void* buffer, int length, int& flags)
 {
-    while (true)
+    while (!TerminationFlag)
     {
         int n = socket.receiveFrame(buffer, length, flags);
         if ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_PING)
@@ -56,6 +56,8 @@ int receiveFrame(WebSocket& socket, void* buffer, int length, int& flags)
             return n;
         }
     }
+
+    return -1;
 }
 
 // Synchronously process WebSocket requests and dispatch to handler.


More information about the Libreoffice-commits mailing list