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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Aug 31 04:41:49 UTC 2016


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

New commits:
commit a674fc7e8fda162b7e84c75902d36cb9b9030650
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Aug 30 18:21:50 2016 -0400

    loolwsd: logs and formatting
    
    Change-Id: Ic3ec268cdc1962814654c7be676da62375494f66
    Reviewed-on: https://gerrit.libreoffice.org/28524
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 944a029..a2ff02e 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -1467,6 +1467,7 @@ void lokit_main(const std::string& childRoot,
                     }
                     else if (document && document->canDiscard())
                     {
+                        Log::info("Last session discarded. Terminating.");
                         TerminationFlag = true;
                     }
                     else
@@ -1480,7 +1481,11 @@ void lokit_main(const std::string& childRoot,
                 [&document]()
                 {
                     if (document && document->canDiscard())
+                    {
+                        Log::info("Last session discarded. Terminating.");
                         TerminationFlag = true;
+                    }
+
                     return TerminationFlag.load();
                 });
 
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 5749f9c..0988b4c 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -911,18 +911,18 @@ public:
                 // http://server/hosting/discovery
                 responded = handleGetWOPIDiscovery(request, response);
             }
-            // All post requests have url prefix, lool
             else if (!(request.find("Upgrade") != request.end() && Poco::icompare(request["Upgrade"], "websocket") == 0) &&
                      reqPathSegs.size() > 0 && reqPathSegs[0] == "lool")
             {
+                // All post requests have url prefix 'lool'.
                 responded = handlePostRequest(request, response, id);
             }
             else if (reqPathSegs.size() > 2 && reqPathSegs[0] == "lool" && reqPathSegs[1] == "ws")
             {
                 auto ws = std::make_shared<WebSocket>(request, response);
+                responded = true; // After upgrading to WS we should not set HTTP response.
                 try
                 {
-                    responded = true; // After upgrading to WS we should not set HTTP response.
                     handleGetRequest(request, ws, id);
                 }
                 catch (const WebSocketErrorMessageException& exc)
@@ -1868,9 +1868,10 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
         else if (pid < 0)
         {
             Log::syserror("waitpid failed.");
-            // No child processes
             if (errno == ECHILD)
             {
+                // No child processes.
+                Log::error("No Forkit instance. Terminating.");
                 TerminationFlag = true;
                 continue;
             }


More information about the Libreoffice-commits mailing list