loolwsd/DocumentBroker.hpp |    4 ++--
 loolwsd/LOOLForKit.cpp     |    5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 5e41763386cdcf5c48a8b9b93411f9a604d41593
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Tue Apr 5 22:37:29 2016 -0400

    loolwsd: disconnect WS before killing/abandoning child
    
    Change-Id: Iff0ac1b57ce9e0fe61871fad9a499d370c2c9294
    Reviewed-on: https://gerrit.libreoffice.org/23858
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 622eab5..f63c5a5 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -20,6 +20,7 @@
 
 #include <Poco/URI.h>
 
+#include "IoUtil.hpp"
 #include "MasterProcessSession.hpp"
 #include "Util.hpp"
 
@@ -75,6 +76,7 @@ public:
     void close(const bool rude)
     {
         Log::info("Closing child [" + std::to_string(_pid) + "].");
+        _ws.reset();
         if (_pid != -1)
         {
             if (rude && kill(_pid, SIGINT) != 0 && kill(_pid, 0) != 0)
@@ -90,8 +92,6 @@ public:
             //IoUtil::writeFIFO(WriterNotify, message.str());
            _pid = -1;
         }
-
-        _ws.reset();
     }
 
     Poco::Process::PID getPid() const { return _pid; }
diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index 42deaff..1bfbdae 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -236,8 +236,7 @@ int main(int argc, char** argv)
 
         if (ForkCounter > 0)
         {
-            // Figure out how many children we need. Always create at least as 
many
-            // as configured pre-spawn or one more than requested (whichever 
is larger).
+            // Create as many as requested.
             int spawn = ForkCounter;
             Log::info() << "Creating " << spawn << " new child." << Log::end;
             size_t newInstances = 0;
@@ -255,7 +254,7 @@ int main(int argc, char** argv)
             while (--spawn > 0);
 
             // If we need to spawn more, retry later.
-            ForkCounter = (newInstances > ForkCounter ? 0 : ForkCounter - 
newInstances);
+            ForkCounter = (newInstances >= ForkCounter ? 0 : ForkCounter - 
newInstances);
         }
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to