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

Tor Lillqvist tml at collabora.com
Mon Oct 10 10:57:00 UTC 2016


 loolwsd/ClientSession.cpp   |    1 -
 loolwsd/ClientSession.hpp   |    9 ---------
 loolwsd/PrisonerSession.cpp |    2 +-
 3 files changed, 1 insertion(+), 11 deletions(-)

New commits:
commit 44d7f26c89a29b0c03137edb6b1b4bf49518ea78
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Oct 10 13:15:15 2016 +0300

    Bin dead code
    
    ClientSession::isLoadFailed() was not used anywhere. As a fallout, the
    _loadFailed field and setLoadFailed() member function became useless,
    too.

diff --git a/loolwsd/ClientSession.cpp b/loolwsd/ClientSession.cpp
index e4623ff..f3acf98 100644
--- a/loolwsd/ClientSession.cpp
+++ b/loolwsd/ClientSession.cpp
@@ -41,7 +41,6 @@ ClientSession::ClientSession(const std::string& id,
     LOOLSession(id, Kind::ToClient, ws),
     _docBroker(std::move(docBroker)),
     _isReadOnly(readOnly),
-    _loadFailed(false),
     _loadPart(-1)
 {
     Log::info("ClientSession ctor [" + getName() + "].");
diff --git a/loolwsd/ClientSession.hpp b/loolwsd/ClientSession.hpp
index 3be6277..926d250 100644
--- a/loolwsd/ClientSession.hpp
+++ b/loolwsd/ClientSession.hpp
@@ -50,13 +50,6 @@ public:
         _saveAsQueue.put(url);
     }
 
-    bool isLoadFailed() const { return _loadFailed; }
-    void setLoadFailed(const std::string& reason)
-    {
-        Log::warn("Document load failed: " + reason);
-        _loadFailed = true;
-    }
-
     std::shared_ptr<DocumentBroker> getDocumentBroker() const { return _docBroker; }
 
 private:
@@ -88,8 +81,6 @@ private:
     /// Store URLs of completed 'save as' documents.
     MessageQueue _saveAsQueue;
 
-    /// Marks if document loading failed.
-    bool _loadFailed;
     int _loadPart;
 };
 
diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp
index c40e4da..ccedaec 100644
--- a/loolwsd/PrisonerSession.cpp
+++ b/loolwsd/PrisonerSession.cpp
@@ -105,7 +105,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
                     errorKind == "wrongpassword")
                 {
                     forwardToPeer(_peer, buffer, length, isBinary);
-                    peer->setLoadFailed(errorKind);
+                    Log::warn("Document load failed: " + errorKind);
                     return false;
                 }
             }


More information about the Libreoffice-commits mailing list