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

Tor Lillqvist tml at collabora.com
Wed Apr 13 08:50:15 UTC 2016


 loolwsd/Connect.cpp |    2 +-
 loolwsd/LOOLWSD.cpp |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 04f3a9e11193567f9ae79e9197101236a845d471
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Apr 13 11:43:08 2016 +0300

    It works better to set TerminationFlag
    
    That global flag is checked all over the place, so setting it will
    actually make the threads eventually finish. (All polling is done with
    timeout, I think, and then checking TerminationFlag whenever the poll
    times out.)
    
    Sure, it would be much better to use an eventfd and poll that, too,
    instead of timing out from the polls all the time to check a plain old
    boolean flag.

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index cc7d6c0..a0fc215 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -1496,7 +1496,7 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
         if (careerSpanSeconds > 0 && time(nullptr) > startTimeSpan + careerSpanSeconds)
         {
             Log::info(std::to_string(time(nullptr) - startTimeSpan) + " seconds gone, finishing as requested.");
-            break;
+            TerminationFlag = true;
         }
 #endif
     }
commit 26ceda2f152e9022d6192f1cb3797f0c439edb12
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Apr 13 10:50:55 2016 +0300

    More specific message

diff --git a/loolwsd/Connect.cpp b/loolwsd/Connect.cpp
index 91c1418..912ac32 100644
--- a/loolwsd/Connect.cpp
+++ b/loolwsd/Connect.cpp
@@ -107,7 +107,7 @@ public:
                 }
             }
             while (n > 0 && (flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE);
-            std::cout << "Websocket closed" << std::endl;
+            std::cout << "CLOSE frame received" << std::endl;
         }
         catch (WebSocketException& exc)
         {


More information about the Libreoffice-commits mailing list