[Libreoffice-commits] online.git: wsd/PrisonerSession.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Jan 1 03:57:45 UTC 2017


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

New commits:
commit 9dfd2008d5ac837092ce03d4d825b729b44df3fc
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Dec 21 21:07:55 2016 -0500

    wsd: send text messages as text not binary
    
    Change-Id: I03dccb8035eb0f1d1fbf85f75f2e4f36af1ce689
    Reviewed-on: https://gerrit.libreoffice.org/32554
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/PrisonerSession.cpp b/wsd/PrisonerSession.cpp
index 77971cf..c0d21a8 100644
--- a/wsd/PrisonerSession.cpp
+++ b/wsd/PrisonerSession.cpp
@@ -61,7 +61,6 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
         throw Poco::ProtocolException("The session has not been assigned a peer.");
     }
 
-    bool isBinary = true;
     if (tokens[0] == "unocommandresult:")
     {
         const std::string stringMsg(buffer, length);
@@ -108,7 +107,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
                     errorKind == "passwordrequired:to-modify" ||
                     errorKind == "wrongpassword")
                 {
-                    forwardToPeer(peer, buffer, length, isBinary);
+                    forwardToPeer(peer, buffer, length, false);
                     LOG_WRN("Document load failed: " << errorKind);
                     return false;
                 }
@@ -174,7 +173,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
             _docBroker->setLoaded();
 
             // Forward the status response to the client.
-            return forwardToPeer(peer, buffer, length, isBinary);
+            return forwardToPeer(peer, buffer, length, false);
         }
         else if (tokens[0] == "commandvalues:")
         {
@@ -253,7 +252,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
     // Detect json messages, since we must send those as text even though they are multiline.
     // If not, the UI will read the first line of a binary payload, assuming that's the only
     // text part and the rest is binary.
-    isBinary = buffer[length - 1] != '}' && firstLine.find('{') == std::string::npos;
+    const bool isBinary = buffer[length - 1] != '}' && firstLine.find('{') == std::string::npos;
 
     // Forward everything else.
     forwardToPeer(peer, buffer, length, isBinary);


More information about the Libreoffice-commits mailing list