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

Henry Castro hcastro at collabora.com
Mon Apr 4 20:28:21 UTC 2016


 loolwsd/LOOLBroker.cpp |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

New commits:
commit 2c18eb8495b90f578ad1c40597fba278fa42b1be
Author: Henry Castro <hcastro at collabora.com>
Date:   Mon Apr 4 16:23:49 2016 -0400

    loolwsd: remove unnecessary response frame
    
    The response was to verify that the command message
    was successfully executed, but it can be replace by log messages.

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index acdd6d0..072e8ff 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -1063,12 +1063,10 @@ static void lokit_main(const std::string& childRoot,
                     const std::string message(data.data(), data.size());
                     Log::debug(socketName + ": recv [" + message + "].");
                     StringTokenizer tokens(message, " ", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
-                    auto responseFrame = std::to_string(Process::id()) + " ";
 
                     if (TerminationFlag)
                     {
-                        // Too late, we're going down.
-                        responseFrame += "down\n";
+                        Log::debug("Too late, we're going down");
                     }
                     else if (tokens[0] == "session")
                     {
@@ -1086,30 +1084,21 @@ static void lokit_main(const std::string& childRoot,
                         }
 
                         // Validate and create session.
-                        if (url == document->getUrl() &&
-                            document->createSession(sessionId, intSessionId))
+                        if (!(url == document->getUrl() &&
+                            document->createSession(sessionId, intSessionId)))
                         {
-                            responseFrame += "ok\n";
-                        }
-                        else
-                        {
-                            responseFrame += "bad\n";
+                            Log::debug("Create Session failed");
                         }
                     }
                     else if (document && document->canDiscard())
                     {
                         TerminationFlag = true;
-                        responseFrame += "down\n";
                     }
                     else
                     {
-                        responseFrame += "bad unknown token [" + tokens[0] + "]\n";
+                        Log::info("bad unknown token [" + tokens[0] + "]");
                     }
 
-                    //FIXME: Do we really need to respond here?
-                    Log::trace("KitToDocBroker: " + responseFrame.substr(0, responseFrame.length()-1));
-                    ws->sendFrame(responseFrame.data(), responseFrame.size());
-
                     return true;
                 },
                 [](){ return TerminationFlag; },


More information about the Libreoffice-commits mailing list