loolwsd/MasterProcessSession.cpp |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 72a1f18ebcb820f3321c56af915fda4a5910592e
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Sat Dec 26 11:30:14 2015 -0500

    loolwsd: fix detection of unreachable child
    
    Change-Id: I619613067586ec824d17cacd6059168e9329ec4c
    Reviewed-on: https://gerrit.libreoffice.org/20974
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index c466ad2..aa7258a 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -554,8 +554,7 @@ void MasterProcessSession::dispatchChild()
     short nRequest = 3;
     bool  bFound = false;
 
-    // Copy document into jail using the fixed name
-
+    // Wait until the child has connected with Master.
     std::shared_ptr<MasterProcessSession> childSession;
     std::unique_lock<std::mutex> lock(_availableChildSessionMutex);
 
@@ -588,7 +587,7 @@ void MasterProcessSession::dispatchChild()
 
     lock.unlock();
 
-    if (!nRequest && !bFound)
+    if (nRequest < 0 && !bFound)
     {
         Log::error("Failed to connect to child. Shutting down socket.");
         Util::shutdownWebSocket(*_ws);
@@ -601,6 +600,7 @@ void MasterProcessSession::dispatchChild()
     if (aUri.isRelative())
         aUri = URI( URI("file://"), aUri.toString() );
 
+    // Copy document into jail using the fixed name
     if (!aUri.empty() && aUri.getScheme() == "file")
     {
         const std::string aJailDoc = jailDocumentURL.substr(1) + 
Path::separator() + std::to_string(childSession->_pidChild);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to