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

Pranav Kant pranavk at collabora.com
Tue Apr 12 10:43:04 UTC 2016


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

New commits:
commit 9efed29c1d50ba9cf8e6e8cf51556d568a1ba0dc
Author: Pranav Kant <pranavk at collabora.com>
Date:   Tue Apr 12 15:44:11 2016 +0530

    loolwsd: Save using session holding the edit-lock
    
    If the first session used to save does not hold the edit-lock,
    all the .uno:Save commands will get converted to dummy messages
    and never reach the kit process.
    
    Change-Id: I36cbee778f8c2c5866dcf276cf156fdf9ed8388e

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 3bc698a..d412b24 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -180,10 +180,13 @@ bool DocumentBroker::autoSave(const bool force)
         {
             Log::info("Auto-save triggered for doc [" + _docKey + "].");
 
-            // Any session can be used to save.
+            // Save using session holding the edit-lock
             bool sent = false;
             for (auto& sessionIt: _wsSessions)
             {
+                if (!sessionIt.second->isEditLocked())
+                    continue;
+
                 auto queue = sessionIt.second->getQueue();
                 if (queue)
                 {


More information about the Libreoffice-commits mailing list