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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Mar 23 00:07:32 UTC 2016


 loolwsd/Admin.cpp |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit ece4538a90adbeb0eeaec9a774797f257e4cc7ca
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Mar 22 19:50:42 2016 -0400

    loolwsd: break admin stat gathering if terminating
    
    Change-Id: I3bd7dd9de829d2658d723da031b533504900054b
    Reviewed-on: https://gerrit.libreoffice.org/23455
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp
index bf6c48c..ca6052b 100644
--- a/loolwsd/Admin.cpp
+++ b/loolwsd/Admin.cpp
@@ -105,14 +105,14 @@ void AdminRequestHandler::handleWSRequests(HTTPServerRequest& request, HTTPServe
                     assert(n > 0);
                     const std::string firstLine = getFirstLine(buffer, n);
                     StringTokenizer tokens(firstLine, " ", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
-                    Log::trace() << "Recv: " << firstLine << Log::end;
+                    Log::trace("Recv: " + firstLine);
 
                     if (firstLine == "eof")
                     {
                         Log::info("Received EOF. Finishing.");
                         break;
                     }
-                    
+
                     if (tokens.count() < 1)
                         continue;
 
@@ -138,7 +138,8 @@ void AdminRequestHandler::handleWSRequests(HTTPServerRequest& request, HTTPServe
                         }
 
                         char treeBuffer[1024];
-                        while (fgets(treeBuffer, sizeof(treeBuffer)-1, fp) != nullptr)
+                        while (fgets(treeBuffer, sizeof(treeBuffer)-1, fp) != nullptr &&
+                               !TerminationFlag)
                         {
                             statsResponse += treeBuffer;
                             statsResponse += "</ BR>\n";


More information about the Libreoffice-commits mailing list