Fix error mapping when session is gracefully shutdown.

This commit is contained in:
Christopher Kohlhoff 2011-10-08 22:13:13 +11:00
parent fa4b15aab8
commit 93bf0f4b8b

View File

@ -194,9 +194,13 @@ const asio::error_code& engine::map_error_code(
return ec;
// Otherwise, the peer should have negotiated a proper shutdown.
ec = asio::error_code(
ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ),
asio::error::get_ssl_category());
if ((::SSL_get_shutdown(ssl_) & SSL_RECEIVED_SHUTDOWN) == 0)
{
ec = asio::error_code(
ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ),
asio::error::get_ssl_category());
}
return ec;
}