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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Apr 24 17:11:08 UTC 2016


 loolwsd/DocumentBroker.cpp |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 6b1a3115b23f4eb33304d911cff806be4f101bd6
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Apr 24 12:40:23 2016 -0400

    loolwsd: request new session from child before storing session
    
    Change-Id: Iadf8a4d30aaab276c55b3bb28c684df0004f8f3c
    Reviewed-on: https://gerrit.libreoffice.org/24339
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 84b2a32..31de15e 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -272,6 +272,11 @@ size_t DocumentBroker::addSession(std::shared_ptr<MasterProcessSession>& session
 
     std::lock_guard<std::mutex> lock(_mutex);
 
+    // Request a new session from the child kit.
+    const std::string aMessage = "session " + id + " " + _docKey + "\n";
+    Log::debug("DocBroker to Child: " + aMessage.substr(0, aMessage.length() - 1));
+    _childProcess->getWebSocket()->sendFrame(aMessage.data(), aMessage.size());
+
     auto ret = _sessions.emplace(id, session);
     if (!ret.second)
     {
@@ -284,12 +289,6 @@ size_t DocumentBroker::addSession(std::shared_ptr<MasterProcessSession>& session
         session->sendTextFrame("editlock: 1");
     }
 
-    // Request a new session from the child kit.
-    const std::string aMessage = "session " + id + " " + _docKey + "\n";
-    Log::debug("DocBroker to Child: " + aMessage.substr(0, aMessage.length() - 1));
-    //FIXME: The socket could be broken, child dead, etc. Must recover!
-    _childProcess->getWebSocket()->sendFrame(aMessage.data(), aMessage.size());
-
     return _sessions.size();
 }
 


More information about the Libreoffice-commits mailing list