aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/vmime/net/pop3/POP3Response.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vmime/net/pop3/POP3Response.cpp b/src/vmime/net/pop3/POP3Response.cpp
index a3961200..2435a3d0 100644
--- a/src/vmime/net/pop3/POP3Response.cpp
+++ b/src/vmime/net/pop3/POP3Response.cpp
@@ -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;
}