[Libreoffice-commits] online.git: Branch 'private/Ashod/nonblocking' - 2 commits - common/SigUtil.cpp wsd/LOOLWSD.cpp

Michael Meeks michael.meeks at collabora.com
Tue Feb 28 09:32:35 UTC 2017


 common/SigUtil.cpp |   12 +++++++++++-
 wsd/LOOLWSD.cpp    |    3 ++-
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit cb41c70e15385ee8fa8e57cd788ac88cbc4b3a04
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Feb 28 09:31:47 2017 +0000

    Wait for more data pleasantly if we fail to parse HTTP header.

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 8315987..964abf1 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2714,7 +2714,8 @@ private:
         catch (const std::exception& exc)
         {
             // Probably don't have enough data just yet.
-            // TODO: Timeout etc.
+            // TODO: timeout if we never get enough.
+            return;
         }
 
         try
commit 1745c204ff858b264c1dce52e1eff9bb77d33e2f
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Feb 28 09:31:34 2017 +0000

    Ctrl-c should really terminate this if you keep going.

diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp
index a5f87fa..63d643b 100644
--- a/common/SigUtil.cpp
+++ b/common/SigUtil.cpp
@@ -111,6 +111,7 @@ namespace SigUtil
     static
     void handleTerminationSignal(const int signal)
     {
+        // FIXME: would love a socket in all SocketPolls to handle shutdown
         if (!ShutdownFlag && signal == SIGINT)
         {
             Log::signalLogPrefix();
@@ -119,7 +120,7 @@ namespace SigUtil
             Log::signalLog("\n");
             SigUtil::requestShutdown();
         }
-        else
+        else if (!TerminationFlag)
         {
             Log::signalLogPrefix();
             Log::signalLog(" Forced-Termination signal received: ");
@@ -127,6 +128,15 @@ namespace SigUtil
             Log::signalLog("\n");
             TerminationFlag = true;
         }
+        else
+        {
+            Log::signalLogPrefix();
+            Log::signalLog(" ok, ok - hard-termination signal received: ");
+            Log::signalLog(signalName(signal));
+            Log::signalLog("\n");
+            ::signal (signal, SIG_DFL);
+            ::raise (signal);
+        }
     }
 
     void setTerminationSignals()


More information about the Libreoffice-commits mailing list