[Libreoffice-commits] online.git: 2 commits - wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp

Pranav Kant pranavk at collabora.co.uk
Fri Jun 23 08:43:02 UTC 2017


 wsd/DocumentBroker.cpp |   21 +++++++--------------
 wsd/DocumentBroker.hpp |    2 +-
 2 files changed, 8 insertions(+), 15 deletions(-)

New commits:
commit c21de445247813c27f66c62a9bf6af03a11386ec
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Jun 21 15:37:38 2017 +0530

    Bin unused parameter, rude
    
    Change-Id: I39f55f55f8a0c5432350625d9720ea2367955a8c
    Reviewed-on: https://gerrit.libreoffice.org/39085
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 7caddd7d..c9c61d4c 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -308,7 +308,7 @@ void DocumentBroker::pollThread()
     }
 
     // Terminate properly while we can.
-    terminateChild(closeReason, false);
+    terminateChild(closeReason);
 
     // Stop to mark it done and cleanup.
     _poll->stop();
@@ -1424,17 +1424,14 @@ void DocumentBroker::childSocketTerminated()
     shutdownClients("terminated");
 }
 
-void DocumentBroker::terminateChild(const std::string& closeReason, const bool rude)
+void DocumentBroker::terminateChild(const std::string& closeReason)
 {
     assertCorrectThread();
 
     LOG_INF("Terminating doc [" << _docKey << "] with reason: " << closeReason);
 
     // Close all running sessions
-    if (!rude)
-    {
-        shutdownClients(closeReason);
-    }
+    shutdownClients(closeReason);
 
     if (_childProcess)
     {
@@ -1442,12 +1439,8 @@ void DocumentBroker::terminateChild(const std::string& closeReason, const bool r
 
         // First flag to stop as it might be waiting on our lock
         // to process some incoming message.
-        if (!rude)
-        {
-            _childProcess->stop();
-        }
-
-        _childProcess->close(rude);
+        _childProcess->stop();
+        _childProcess->close(false);
     }
 
     _stop = true;
@@ -1458,7 +1451,7 @@ void DocumentBroker::closeDocument(const std::string& reason)
     assertCorrectThread();
 
     LOG_DBG("Closing DocumentBroker for docKey [" << _docKey << "] with reason: " << reason);
-    terminateChild(reason, false);
+    terminateChild(reason);
 }
 
 void DocumentBroker::broadcastMessage(const std::string& message)
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 6069b9c0..98094da2 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -349,7 +349,7 @@ private:
 
     /// This gracefully terminates the connection
     /// with the child and cleans up ChildProcess etc.
-    void terminateChild(const std::string& closeReason, const bool rude);
+    void terminateChild(const std::string& closeReason);
 
     /// Saves the doc to the storage.
     bool saveToStorageInternal(const std::string& sesionId, bool success, const std::string& result = "");
commit 6c6ddbe4253152517312a32cc8cb7fdb22633f37
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Jun 21 16:52:03 2017 +0530

    Remove redundant function call
    
    This is called later after the while loop. Breaking out of while loop
    should be enough.
    
    Change-Id: I04979d3af1f475c05b5a43d7afe47770ff69ee25
    Reviewed-on: https://gerrit.libreoffice.org/39086
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index f1785de5..7caddd7d 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -267,7 +267,7 @@ void DocumentBroker::pollThread()
         if (ShutdownRequestFlag)
         {
             closeReason = "recycling";
-            shutdownClients(closeReason);
+            _stop = true;
         }
         else if (AutoSaveEnabled && !_stop &&
                  std::chrono::duration_cast<std::chrono::seconds>(now - last30SecCheckTime).count() >= 30)


More information about the Libreoffice-commits mailing list