[Libreoffice-commits] online.git: net/Socket.hpp net/SslSocket.hpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 26 07:07:48 UTC 2018


 net/Socket.hpp    |   17 ++++++++++++++++-
 net/SslSocket.hpp |    8 ++++----
 2 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 5167cf9f58196c6d8289ea025894f122c439531e
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Fri Oct 26 09:07:07 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Fri Oct 26 09:07:30 2018 +0200

    StreamSocket: make members private
    
    Only a single member needed a setter, otherwise getters were enough.

diff --git a/net/Socket.hpp b/net/Socket.hpp
index 698edd328..0c58d20aa 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -1091,7 +1091,22 @@ protected:
 
     void dumpState(std::ostream& os) override;
 
-protected:
+    void setShutdownSignalled(bool shutdownSignalled)
+    {
+        _shutdownSignalled = shutdownSignalled;
+    }
+
+    bool isShutdownSignalled() const
+    {
+        return _shutdownSignalled;
+    }
+
+    const std::shared_ptr<SocketHandlerInterface>& getSocketHandler() const
+    {
+        return _socketHandler;
+    }
+
+  private:
     /// Client handling the actual data.
     std::shared_ptr<SocketHandlerInterface> _socketHandler;
 
diff --git a/net/SslSocket.hpp b/net/SslSocket.hpp
index 44a2fa382..de16fdf1d 100644
--- a/net/SslSocket.hpp
+++ b/net/SslSocket.hpp
@@ -60,9 +60,9 @@ public:
     {
         LOG_DBG("SslStreamSocket dtor #" << getFD());
 
-        if (!_shutdownSignalled)
+        if (!isShutdownSignalled())
         {
-            _shutdownSignalled = true;
+            setShutdownSignalled(true);
             SslStreamSocket::closeConnection();
         }
 
@@ -128,7 +128,7 @@ public:
                       int & timeoutMaxMs) override
     {
         assertCorrectThread();
-        int events = _socketHandler->getPollEvents(now, timeoutMaxMs);
+        int events = getSocketHandler()->getPollEvents(now, timeoutMaxMs);
 
         if (_sslWantsTo == SslWantsTo::Read)
         {
@@ -141,7 +141,7 @@ public:
             return POLLOUT;
         }
 
-        if (!_outBuffer.empty() || _shutdownSignalled)
+        if (!getOutBuffer().empty() || isShutdownSignalled())
             events |= POLLOUT;
 
         return events;


More information about the Libreoffice-commits mailing list