[Libreoffice-commits] online.git: 4 commits - loolwsd/LOOLKit.cpp loolwsd/LOOLSession.cpp loolwsd/LOOLWSD.cpp loolwsd/MasterProcessSession.cpp

Tor Lillqvist tml at collabora.com
Mon Feb 22 15:37:49 UTC 2016


 loolwsd/LOOLKit.cpp              |    2 +-
 loolwsd/LOOLSession.cpp          |    5 ++++-
 loolwsd/LOOLWSD.cpp              |    4 ++--
 loolwsd/MasterProcessSession.cpp |    2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 00e3d6ca20f44ad3c3a867e3f17269adda11a4c9
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 22 17:09:59 2016 +0200

    Cosmetics: add a space

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 340f101..9b35eeb 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -396,7 +396,7 @@ public:
         }
 
         Log::info() << "Creating " << (_clientViews ? "new" : "first")
-                    << " view for url: " << _url << "for thread: " << sessionId
+                    << " view for url: " << _url << " for thread: " << sessionId
                     << " on child: " << _jailId << Log::end;
 
         // Open websocket connection between the child process and the
commit 819d5c23c0a344a7d14fc69d7aa11b4a5a5b1cfa
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 22 16:31:24 2016 +0200

    Use all tokens

diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 04eea14..82ece7d 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -84,7 +84,7 @@ bool MasterProcessSession::handleDisconnect(Poco::StringTokenizer& tokens)
     auto peer = _peer.lock();
     if (peer)
     {
-        const auto reason = (tokens.count() > 1 ? tokens[1] : std::string());
+        const auto reason = (tokens.count() > 1 ? Poco::cat(std::string(" "), tokens.begin() + 1, tokens.end()) : "");
         peer->disconnect(reason);
     }
 
commit 7ced4adc5ed10718b882528ce20080fb3122deb4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 22 16:30:42 2016 +0200

    Just use "" instead of std::string()

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 1be9a5d..feb7bef 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -348,7 +348,7 @@ private:
                     auto session = std::make_shared<MasterProcessSession>(id, kind, ws);
                     const std::string filePrefix("file://");
                     std::string encodedFrom;
-                    URI::encode(filePrefix + fromPath, std::string(), encodedFrom);
+                    URI::encode(filePrefix + fromPath, "", encodedFrom);
                     const std::string load = "load url=" + encodedFrom;
                     session->handleInput(load.data(), load.size());
 
@@ -357,7 +357,7 @@ private:
                     toPath.setExtension(format);
                     std::string toJailURL = filePrefix + JailedDocumentRoot + toPath.getFileName();
                     std::string encodedTo;
-                    URI::encode(toJailURL, std::string(), encodedTo);
+                    URI::encode(toJailURL, "", encodedTo);
                         std::string saveas = "saveas url=" + encodedTo + " format=" + format + " options=";
                     session->handleInput(saveas.data(), saveas.size());
 
commit 72ff491fb26e46d2a6e42412f18a74ba875e5afa
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 22 16:27:12 2016 +0200

    Cosmetics: avoid trailing space in 'disconnect' message

diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 08f10d5..433d9fd 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -171,7 +171,10 @@ void LOOLSession::disconnect(const std::string& reason)
 {
     if (!_disconnected)
     {
-        sendTextFrame("disconnect " + reason);
+        if (reason != "")
+            sendTextFrame("disconnect " + reason);
+        else
+            sendTextFrame("disconnect");
         _disconnected = true;
         Util::shutdownWebSocket(_ws);
     }


More information about the Libreoffice-commits mailing list