diff options
author | Vincent Richard <[email protected]> | 2014-03-07 21:41:05 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2014-03-07 21:41:05 +0000 |
commit | 012989f8fd572fa1df0f87994530644e4ede2409 (patch) | |
tree | e414507cf2201e4564e076ffa9e12b0b9757d68e | |
parent | Compilation fixes for Windows. (diff) | |
download | vmime-012989f8fd572fa1df0f87994530644e4ede2409.tar.gz vmime-012989f8fd572fa1df0f87994530644e4ede2409.zip |
Retry reading from the stream instead of waiting for input data on socket.
Diffstat (limited to '')
-rw-r--r-- | src/vmime/net/pop3/POP3Response.cpp | 12 |
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; } |