Fix crashes in sdremote after suspend/resume cycles.

Change-Id: I0f64820887919386f266290ae8b7c53f8a0a5458
This commit is contained in:
Thorsten Behrens
2013-02-19 12:18:12 +01:00
parent 4c7d04c681
commit 25f7288ff8
2 changed files with 5 additions and 4 deletions

View File

@@ -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 )

View File

@@ -52,6 +52,7 @@ void Receiver::Timeout()
{
std::vector< rtl::OString > aCommands( maExecQueue.front() );
maExecQueue.pop_front();
if( !aCommands.empty() )
executeCommand( aCommands );
Start();
}