Fix to #380. DialogSocket was crashing (SIGSEGV) when a timeout occours.

This commit is contained in:
Cristian Thiago Moecke
2014-02-21 03:44:54 -08:00
parent 0ad18f3e80
commit c3ffe405cf

View File

@@ -239,10 +239,13 @@ void DialogSocket::refill()
if (_pNext == _pEnd) if (_pNext == _pEnd)
{ {
int n = receiveBytes(_pBuffer, RECEIVE_BUFFER_SIZE); int n = receiveBytes(_pBuffer, RECEIVE_BUFFER_SIZE);
if (n > 0)
{
_pNext = _pBuffer; _pNext = _pBuffer;
_pEnd = _pBuffer + n; _pEnd = _pBuffer + n;
} }
} }
}
void DialogSocket::allocBuffer() void DialogSocket::allocBuffer()