porting 1.4.4 rev. 1968 (fixed SF# 3559665, etc.)

This commit is contained in:
Aleksandar Fabijanic
2012-08-23 03:15:19 +00:00
parent dbda035719
commit 2a6d58c7f2
4 changed files with 27 additions and 8 deletions

View File

@@ -231,12 +231,12 @@ void SecureSocketImpl::listen(int backlog)
void SecureSocketImpl::shutdown()
{
if (_pSSL)
{
// Don't shut down the socket more than once.
int shutdownState = SSL_get_shutdown(_pSSL);
bool shutdownSent = (shutdownState & SSL_SENT_SHUTDOWN) == SSL_SENT_SHUTDOWN;
if (!shutdownSent)
{
{
// Don't shut down the socket more than once.
int shutdownState = SSL_get_shutdown(_pSSL);
bool shutdownSent = (shutdownState & SSL_SENT_SHUTDOWN) == SSL_SENT_SHUTDOWN;
if (!shutdownSent)
{
// A proper clean shutdown would require us to
// retry the shutdown if we get a zero return
// value, until SSL_shutdown() returns 1.
@@ -254,7 +254,7 @@ void SecureSocketImpl::shutdown()
void SecureSocketImpl::close()
{
shutdown();
try { shutdown(); } catch (...) { }
_pSocket->close();
}