[Libreoffice-commits] online.git: loolwsd/LOOLSession.hpp loolwsd/LOOLWSD.cpp

Henry Castro hcastro at collabora.com
Wed Dec 2 16:20:05 PST 2015


 loolwsd/LOOLSession.hpp |    7 ++++---
 loolwsd/LOOLWSD.cpp     |    5 +++++
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit f5b6aa651537d8ef82318e6c92e5dba4e57a7d6d
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Dec 2 20:15:39 2015 -0400

    loolwsd: shut down web sockets that are not yet assigned a document to work on

diff --git a/loolwsd/LOOLSession.hpp b/loolwsd/LOOLSession.hpp
index 3fe471a..4ed8eac 100644
--- a/loolwsd/LOOLSession.hpp
+++ b/loolwsd/LOOLSession.hpp
@@ -132,6 +132,10 @@ public:
      */
     std::string getSaveAs();
 
+    // Sessions to pre-spawned child processes that have connected but are not yet assigned a
+    // document to work on.
+    static std::set<std::shared_ptr<MasterProcessSession>> _availableChildSessions;
+
  protected:
     bool invalidateTiles(const char *buffer, int length, Poco::StringTokenizer& tokens);
 
@@ -153,9 +157,6 @@ public:
     // per document being edited (i.e., per child process).
     std::weak_ptr<MasterProcessSession> _peer;
 
-    // Sessions to pre-spawned child processes that have connected but are not yet assigned a
-    // document to work on.
-    static std::set<std::shared_ptr<MasterProcessSession>> _availableChildSessions;
     static std::mutex _availableChildSessionMutex;
     static std::condition_variable _availableChildSessionCV;
 
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index b1f0138..f8882e0 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -1327,10 +1327,15 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
     // stop the service, no more request
     srv.stop();
     srv2.stop();
+
     // close all websockets
     threadPool.joinAll();
     threadPool2.joinAll();
 
+    // Clear sessions to pre-spawned child processes that have connected
+    // but are not yet assigned a document to work on.
+    MasterProcessSession::_availableChildSessions.clear();
+
     // wait broker process finish
     waitpid(-1, &status, WUNTRACED);
 


More information about the Libreoffice-commits mailing list