Retry reading from the stream instead of waiting for input data on socket.

This commit is contained in:
Vincent Richard 2014-03-07 22:41:05 +01:00
parent 5fb3f5a15f
commit 012989f8fd

View File

@ -274,9 +274,19 @@ void POP3Response::readResponseImpl
if (read == 0) // buffer is empty
{
if (m_socket->getStatus() & socket::STATUS_WANT_WRITE)
{
m_socket->waitForWrite();
else
}
else if (m_socket->getStatus() & socket::STATUS_WANT_READ)
{
m_socket->waitForRead();
}
else
{
// Input stream needs more bytes to continue, but there
// is enough data into socket buffer. Do not waitForRead(),
// just retry read()ing on the stream.
}
continue;
}