[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - kit/ChildSession.cpp wsd/DocumentBroker.cpp

Pranav Kant pranavk at collabora.co.uk
Mon Aug 14 15:51:18 UTC 2017


 kit/ChildSession.cpp   |    7 -------
 wsd/DocumentBroker.cpp |    6 ++++++
 2 files changed, 6 insertions(+), 7 deletions(-)

New commits:
commit e6fd8fcc0ac33c5fe874e0a812eb5fda34982a2e
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Aug 11 23:10:34 2017 +0530

    wsd: Ignore useractive, userinactive when doc is not loaded
    
    Sometimes client sends a userinactive message while the document is
    already being loaded, which leads to the kit process skipping sending
    the result of LOK callbacks to the client.
    
    Handling this in child session is futile in the case when userinactive
    message is sent when the document is being loaded, since kit process
    handles the 'userinactive' message only after document is loaded (i.e
    isLoaded() returns true). Moving this handling to DocumentBroker will
    take care of both the cases - when 'userinactive' is sent before load
    starts, and during load of the document.
    
    Change-Id: I4ea3ac7b184d2ca373eb3ff4fb7b4ae394d454df
    (cherry picked from commit ef54b6ea167471ba5dc50947bc071a4c5f58c43f)
    Reviewed-on: https://gerrit.libreoffice.org/41059
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 4fd77800..7ad0cdd0 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -183,13 +183,6 @@ bool ChildSession::_handleInput(const char *buffer, int length)
     }
     else if (!_isDocLoaded)
     {
-        // Be forgiving to these messages while we load.
-        if (tokens[0] == "useractive" ||
-            tokens[0] == "userinactive")
-        {
-            return true;
-        }
-
         sendTextFrame("error: cmd=" + tokens[0] + " kind=nodocloaded");
         return false;
     }
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 818ecfb1..84e7441c 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1255,6 +1255,12 @@ bool DocumentBroker::forwardToChild(const std::string& viewId, const std::string
 {
     assertCorrectThread();
 
+    // Ignore userinactive, useractive message until document is loaded
+    if (!isLoaded() && (message == "userinactive" || message == "useractive"))
+    {
+        return true;
+    }
+
     LOG_TRC("Forwarding payload to child [" << viewId << "]: " << message);
 
     std::string msg = "child-" + viewId + ' ' + message;


More information about the Libreoffice-commits mailing list