Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74825 - trunk/boost/asio/ssl/detail/impl
From: chris_at_[hidden]
Date: 2011-10-08 17:38:44


Author: chris_kohlhoff
Date: 2011-10-08 17:38:43 EDT (Sat, 08 Oct 2011)
New Revision: 74825
URL: http://svn.boost.org/trac/boost/changeset/74825

Log:
Fix error mapping when session is gracefully shut down.
Text files modified:
   trunk/boost/asio/ssl/detail/impl/engine.ipp | 10 +++++++---
   1 files changed, 7 insertions(+), 3 deletions(-)

Modified: trunk/boost/asio/ssl/detail/impl/engine.ipp
==============================================================================
--- trunk/boost/asio/ssl/detail/impl/engine.ipp (original)
+++ trunk/boost/asio/ssl/detail/impl/engine.ipp 2011-10-08 17:38:43 EDT (Sat, 08 Oct 2011)
@@ -195,9 +195,13 @@
     return ec;
 
   // Otherwise, the peer should have negotiated a proper shutdown.
- ec = boost::system::error_code(
- ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ),
- boost::asio::error::get_ssl_category());
+ if ((::SSL_get_shutdown(ssl_) & SSL_RECEIVED_SHUTDOWN) == 0)
+ {
+ ec = boost::system::error_code(
+ ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ),
+ boost::asio::error::get_ssl_category());
+ }
+
   return ec;
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk