[Libreoffice-commits] core.git: sd/source
Thorsten Behrens
tbehrens at suse.com
Tue Feb 19 03:19:50 PST 2013
sd/source/ui/remotecontrol/BufferedStreamSocket.cxx | 6 +++---
sd/source/ui/remotecontrol/Receiver.cxx | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 25f7288ff8ea26e3d3976329d6bbcfe7ca5c5260
Author: Thorsten Behrens <tbehrens at suse.com>
Date: Tue Feb 19 12:18:12 2013 +0100
Fix crashes in sdremote after suspend/resume cycles.
Change-Id: I0f64820887919386f266290ae8b7c53f8a0a5458
diff --git a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
index 30022d6..50ee736 100644
--- a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
+++ b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
@@ -77,7 +77,7 @@ sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
// Process buffer first incase data already present.
vector<char>::iterator aIt;
if ( (aIt = find( aBuffer.begin(), aBuffer.end(), '\n' ))
- != aBuffer.end() )
+ != aBuffer.end() )
{
sal_uInt64 aLocation = aIt - aBuffer.begin();
@@ -96,9 +96,9 @@ sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
else
aRet = ::recv( mSocket, &aBuffer[aRead], 100, 0 );
- if ( aRet == 0 )
+ if ( aRet <= 0 )
{
- return aRet;
+ return 0;
}
// Prevent buffer from growing massively large.
if ( aRead > MAX_LINE_LENGTH )
diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx
index 572551d..3ec14de 100644
--- a/sd/source/ui/remotecontrol/Receiver.cxx
+++ b/sd/source/ui/remotecontrol/Receiver.cxx
@@ -52,7 +52,8 @@ void Receiver::Timeout()
{
std::vector< rtl::OString > aCommands( maExecQueue.front() );
maExecQueue.pop_front();
- executeCommand( aCommands );
+ if( !aCommands.empty() )
+ executeCommand( aCommands );
Start();
}
else
More information about the Libreoffice-commits
mailing list