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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Oct 16 22:06:39 UTC 2016


 loolwsd/LOOLWSD.cpp |   29 -----------------------------
 1 file changed, 29 deletions(-)

New commits:
commit d4214c555f363c41c7768a83d33e9de1f6538eb3
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Fri Oct 14 22:55:07 2016 -0400

    loolwsd: kill waitBridgeCompleted and AvailableChildSessions
    
    Change-Id: I26eac76135d35ea17ac7e6d2697df81ad07a1d73
    Reviewed-on: https://gerrit.libreoffice.org/29941
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index f709749..a9d08d2 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -169,11 +169,6 @@ static std::condition_variable newChildrenCV;
 static std::chrono::steady_clock::time_point lastForkRequestTime = std::chrono::steady_clock::now();
 static std::map<std::string, std::shared_ptr<DocumentBroker>> docBrokers;
 static std::mutex docBrokersMutex;
-// Sessions to pre-spawned child processes that have connected but are not yet assigned a
-// document to work on.
-static std::mutex AvailableChildSessionMutex;
-static std::condition_variable AvailableChildSessionCV;
-static std::map<std::string, std::shared_ptr<PrisonerSession>> AvailableChildSessions;
 
 #if ENABLE_DEBUG
 static int careerSpanSeconds = 0;
@@ -401,30 +396,6 @@ private:
         return "application/octet-stream";
     }
 
-    static void waitBridgeCompleted(const std::shared_ptr<ClientSession>& session)
-    {
-        bool isFound = false;
-        std::unique_lock<std::mutex> lock(AvailableChildSessionMutex);
-        Log::debug() << "Waiting for client session [" << session->getId() << "] to connect." << Log::end;
-        AvailableChildSessionCV.wait_for(
-            lock,
-            std::chrono::milliseconds(COMMAND_TIMEOUT_MS),
-            [&isFound, &session]
-            {
-                return (isFound = AvailableChildSessions.find(session->getId()) != AvailableChildSessions.end());
-            });
-
-        if (!isFound)
-        {
-            // Let the client know we can't serve now.
-            Log::error(session->getName() + ": Failed to connect to lokit process. Client cannot serve now.");
-            throw WebSocketErrorMessageException(SERVICE_UNAVAILABLE_INTERNAL_ERROR);
-        }
-
-        Log::debug("Waiting child session permission, done!");
-        AvailableChildSessions.erase(session->getId());
-    }
-
     /// Handle POST requests.
     /// Always throw on error, do not set response status here.
     /// Returns true if a response has been sent.


More information about the Libreoffice-commits mailing list