Hi,
If I were to perform reads as follows
do
{
// Perform the read
int ReceiveResult = SSL_read(m_SSLObject, DataBuffer,
m_BIOPairBufferSize);
int ErrorCode = SSL_get_error(m_SSLObject,
ReceiveResult);
switch (ErrorCode)
{
case SSL_ERROR_NONE:
{
// Append read application data
ReceiveBuffer.append(DataBuffer,
ReceiveResult);
break;
}
case SSL_ERROR_ZERO_RETURN:
{
// We have received a close
notify alert
}
case SSL_ERROR_WANT_READ:
case SSL_ERROR_WANT_WRITE:
case SSL_ERROR_SYSCALL:
case SSL_ERROR_SSL:
case SSL_ERROR_WANT_X509_LOOKUP:
default:
{
throw
WinsockException(m_SocketImpl, ErrorCode, __FILE__, __LINE__);
}
} // END switch (ErrorCode)
} while (SSL_pending(m_SSLObject) > 0);
Would there ever be a case where the SSL_ERROR_NONE case is executed, and
then on the next iteration of the do/while loop (as there is a "close
notify" message in the BIO pair buffers), the SSL_ERROR_ZERO_RETURN case is
executed?
Many thanks,
Constantin