Fix crashes in sdremote after suspend/resume cycles.
Change-Id: I0f64820887919386f266290ae8b7c53f8a0a5458
This commit is contained in:
@@ -77,7 +77,7 @@ sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
|
|||||||
// Process buffer first incase data already present.
|
// Process buffer first incase data already present.
|
||||||
vector<char>::iterator aIt;
|
vector<char>::iterator aIt;
|
||||||
if ( (aIt = find( aBuffer.begin(), aBuffer.end(), '\n' ))
|
if ( (aIt = find( aBuffer.begin(), aBuffer.end(), '\n' ))
|
||||||
!= aBuffer.end() )
|
!= aBuffer.end() )
|
||||||
{
|
{
|
||||||
sal_uInt64 aLocation = aIt - aBuffer.begin();
|
sal_uInt64 aLocation = aIt - aBuffer.begin();
|
||||||
|
|
||||||
@@ -96,9 +96,9 @@ sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
|
|||||||
else
|
else
|
||||||
aRet = ::recv( mSocket, &aBuffer[aRead], 100, 0 );
|
aRet = ::recv( mSocket, &aBuffer[aRead], 100, 0 );
|
||||||
|
|
||||||
if ( aRet == 0 )
|
if ( aRet <= 0 )
|
||||||
{
|
{
|
||||||
return aRet;
|
return 0;
|
||||||
}
|
}
|
||||||
// Prevent buffer from growing massively large.
|
// Prevent buffer from growing massively large.
|
||||||
if ( aRead > MAX_LINE_LENGTH )
|
if ( aRead > MAX_LINE_LENGTH )
|
||||||
|
@@ -52,7 +52,8 @@ void Receiver::Timeout()
|
|||||||
{
|
{
|
||||||
std::vector< rtl::OString > aCommands( maExecQueue.front() );
|
std::vector< rtl::OString > aCommands( maExecQueue.front() );
|
||||||
maExecQueue.pop_front();
|
maExecQueue.pop_front();
|
||||||
executeCommand( aCommands );
|
if( !aCommands.empty() )
|
||||||
|
executeCommand( aCommands );
|
||||||
Start();
|
Start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user