[Libreoffice-commits] online.git: loolwsd/ClientSession.cpp loolwsd/ClientSession.hpp loolwsd/LOOLSession.hpp loolwsd/LOOLWSD.cpp loolwsd/PrisonerSession.cpp loolwsd/PrisonerSession.hpp

Tor Lillqvist tml at collabora.com
Wed Oct 12 10:40:56 UTC 2016


 loolwsd/ClientSession.cpp   |    4 ++--
 loolwsd/ClientSession.hpp   |    2 +-
 loolwsd/LOOLSession.hpp     |    4 ++--
 loolwsd/LOOLWSD.cpp         |   10 +++++-----
 loolwsd/PrisonerSession.cpp |    4 ++--
 loolwsd/PrisonerSession.hpp |    2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit e07069eda2cecfdf7cc08bbb2c1003a817a2fd0c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Oct 12 13:05:57 2016 +0300

    Drop parameter when we always pass the same value for it
    
    For the 'message' parameter of LOOLSession::shutdown(),
    ClientSession::shutdownPeer(), and PrisonerSession::shutdownPeer() we
    always passed "". It was passed on as the 'statusMessage' parameter to
    WebSocet::shutdown() which has "" as default anyway.

diff --git a/loolwsd/ClientSession.cpp b/loolwsd/ClientSession.cpp
index 6e8a60e..32a2c1f 100644
--- a/loolwsd/ClientSession.cpp
+++ b/loolwsd/ClientSession.cpp
@@ -348,12 +348,12 @@ bool ClientSession::sendCombinedTiles(const char* /*buffer*/, int /*length*/, St
     return true;
 }
 
-bool ClientSession::shutdownPeer(Poco::UInt16 statusCode, const std::string& message)
+bool ClientSession::shutdownPeer(Poco::UInt16 statusCode)
 {
     auto peer = _peer.lock();
     if (peer && !peer->isCloseFrame())
     {
-        peer->shutdown(statusCode, message);
+        peer->shutdown(statusCode);
     }
     return peer != nullptr;
 }
diff --git a/loolwsd/ClientSession.hpp b/loolwsd/ClientSession.hpp
index 926d250..ba8d985 100644
--- a/loolwsd/ClientSession.hpp
+++ b/loolwsd/ClientSession.hpp
@@ -31,7 +31,7 @@ public:
 
     void setPeer(const std::shared_ptr<PrisonerSession>& peer) { _peer = peer; }
     std::shared_ptr<PrisonerSession> getPeer() const { return _peer.lock(); }
-    bool shutdownPeer(Poco::UInt16 statusCode, const std::string& message);
+    bool shutdownPeer(Poco::UInt16 statusCode);
 
     void setUserName(const std::string& userName) { _userName = userName; }
 
diff --git a/loolwsd/LOOLSession.hpp b/loolwsd/LOOLSession.hpp
index b07b2c6..11390cc 100644
--- a/loolwsd/LOOLSession.hpp
+++ b/loolwsd/LOOLSession.hpp
@@ -59,11 +59,11 @@ public:
     /// Called to handle disconnection command from socket.
     virtual bool handleDisconnect();
 
-    void shutdown(Poco::UInt16 statusCode, const std::string& message)
+    void shutdown(Poco::UInt16 statusCode)
     {
         if (_ws)
         {
-            _ws->shutdown(statusCode, message);
+            _ws->shutdown(statusCode);
         }
     }
 
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 7151e22..cb5e94f 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -507,7 +507,7 @@ private:
                         Log::error("Multiple sessions during conversion. " + std::to_string(sessionsCount) + " sessions remain.");
                     }
 
-                    session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE, "");
+                    session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE);
                 }
 
                 // Clean up the temporary directory the HTMLForm ctor created.
@@ -884,7 +884,7 @@ private:
         if (session->isCloseFrame())
         {
             Log::trace("Normal close handshake.");
-            if (session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE, ""))
+            if (session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE))
             {
                 // Client initiated close handshake
                 // respond close frame
@@ -897,7 +897,7 @@ private:
             Log::trace("Abnormal close handshake.");
             session->closeFrame();
             ws->shutdown(WebSocket::WS_ENDPOINT_GOING_AWAY);
-            session->shutdownPeer(WebSocket::WS_ENDPOINT_GOING_AWAY, "");
+            session->shutdownPeer(WebSocket::WS_ENDPOINT_GOING_AWAY);
         }
     }
 
@@ -1262,7 +1262,7 @@ public:
             if (session->isCloseFrame())
             {
                 Log::trace("Normal close handshake.");
-                if (session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE, ""))
+                if (session->shutdownPeer(WebSocket::WS_NORMAL_CLOSE))
                 {
                     // LOKit initiated close handshake
                     // respond close frame
@@ -1275,7 +1275,7 @@ public:
                 Log::trace("Abnormal close handshake.");
                 session->closeFrame();
                 ws->shutdown(WebSocket::WS_ENDPOINT_GOING_AWAY);
-                session->shutdownPeer(WebSocket::WS_ENDPOINT_GOING_AWAY, "");
+                session->shutdownPeer(WebSocket::WS_ENDPOINT_GOING_AWAY);
             }
         }
         catch (const Exception& exc)
diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp
index 2f08f63..b1b5f91 100644
--- a/loolwsd/PrisonerSession.cpp
+++ b/loolwsd/PrisonerSession.cpp
@@ -254,12 +254,12 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
     return true;
 }
 
-bool PrisonerSession::shutdownPeer(Poco::UInt16 statusCode, const std::string& message)
+bool PrisonerSession::shutdownPeer(Poco::UInt16 statusCode)
 {
     auto peer = _peer.lock();
     if (peer && !peer->isCloseFrame())
     {
-        peer->shutdown(statusCode, message);
+        peer->shutdown(statusCode);
     }
 
     return peer != nullptr;
diff --git a/loolwsd/PrisonerSession.hpp b/loolwsd/PrisonerSession.hpp
index a40ce98..bcd386a 100644
--- a/loolwsd/PrisonerSession.hpp
+++ b/loolwsd/PrisonerSession.hpp
@@ -26,7 +26,7 @@ public:
     virtual ~PrisonerSession();
 
     void setPeer(const std::shared_ptr<ClientSession>& peer) { _peer = peer; }
-    bool shutdownPeer(Poco::UInt16 statusCode, const std::string& message);
+    bool shutdownPeer(Poco::UInt16 statusCode);
 
 private:
 


More information about the Libreoffice-commits mailing list