sd/source/ui/remotecontrol/BufferedStreamSocket.cxx |   20 +++++++++-----------
 sd/source/ui/remotecontrol/BufferedStreamSocket.hxx |    2 +-
 sd/source/ui/remotecontrol/Server.cxx               |    3 +--
 3 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 3d4e2135b78015bc739f0f5b238cf184305ebcba
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Aug 21 20:58:18 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Aug 22 09:36:46 2024 +0200

    read count doesn't need to be a class member
    
    Change-Id: Icac6d1ea5659d875551b7b218fc47235fec34dc7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172223
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx 
b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
index 64ad5eb8d597..e2fe96fc383e 100644
--- a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
+++ b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
@@ -28,7 +28,6 @@ using namespace osl;
 
 BufferedStreamSocket::BufferedStreamSocket( const osl::StreamSocket &aSocket ):
     StreamSocket( aSocket ),
-    aRet( 0 ),
     aRead( 0 ),
     mSocket( 0 ),
     usingCSocket( false )
@@ -36,7 +35,6 @@ BufferedStreamSocket::BufferedStreamSocket( const 
osl::StreamSocket &aSocket ):
 }
 
 BufferedStreamSocket::BufferedStreamSocket( int aSocket ):
-    aRet( 0 ),
     aRead( 0 ),
     mSocket( aSocket ),
     usingCSocket( true )
@@ -106,25 +104,25 @@ sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
 
         // Then try and receive if nothing present
         aBuffer.resize( aRead + 100 );
-        if ( !usingCSocket)
-            aRet = StreamSocket::recv( &aBuffer[aRead], 100 );
+
+        sal_Int32 nRet;
+        if (!usingCSocket)
+            nRet = StreamSocket::recv( &aBuffer[aRead], 100 );
         else
-            aRet = ::recv( mSocket, &aBuffer[aRead], 100, 0 );
+            nRet = ::recv( mSocket, &aBuffer[aRead], 100, 0 );
 
-        SAL_INFO( "sdremote.bluetooth", "recv " << aRet << " aBuffer len " << 
aBuffer.size() );
-        if ( aRet <= 0 )
-        {
+        SAL_INFO( "sdremote.bluetooth", "recv " << nRet << " aBuffer len " << 
aBuffer.size() );
+        if (nRet <= 0)
             return 0;
-        }
+
         // Prevent buffer from growing massively large.
         if ( aRead > MAX_LINE_LENGTH )
         {
             aBuffer.clear();
             return 0;
         }
-        aRead += aRet;
+        aRead += nRet;
     }
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/remotecontrol/BufferedStreamSocket.hxx 
b/sd/source/ui/remotecontrol/BufferedStreamSocket.hxx
index 6abf7ec1bf8d..d675f3d9acc0 100644
--- a/sd/source/ui/remotecontrol/BufferedStreamSocket.hxx
+++ b/sd/source/ui/remotecontrol/BufferedStreamSocket.hxx
@@ -56,7 +56,7 @@ namespace sd
 
             void getPeerAddr(osl::SocketAddr&);
         private:
-            sal_Int32 aRet, aRead;
+            sal_Int32 aRead;
             std::vector<char> aBuffer;
             int mSocket;
             bool usingCSocket;
commit 2d4cba825b217e4361551b8551cdaf9bc5ef7ca0
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Aug 21 20:30:38 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Aug 22 09:36:39 2024 +0200

    cid#1608175 Structurally dead code
    
    trivial, no real change here
    
    Change-Id: I0e93412c930d60d94a9e9406579226026f449897
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172222
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sd/source/ui/remotecontrol/Server.cxx 
b/sd/source/ui/remotecontrol/Server.cxx
index aec4fb1be445..12c494121e9e 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -97,8 +97,7 @@ void IPRemoteServer::execute()
         if ( mSocket.acceptConnection( aSocket ) == osl_Socket_Error )
         {
             SAL_WARN( "sdremote", "accept failed" << 
mSocket.getErrorAsString() );
-            spServer = nullptr;
-            return; // Closed, or other issue.
+            break; // Closed, or other issue.
         }
         BufferedStreamSocket *pSocket = new BufferedStreamSocket( aSocket);
         handleAcceptedConnection( pSocket );

Reply via email to