summaryrefslogtreecommitdiff
path: root/boost/asio/ssl/detail/shutdown_op.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/ssl/detail/shutdown_op.hpp')
-rw-r--r--boost/asio/ssl/detail/shutdown_op.hpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/boost/asio/ssl/detail/shutdown_op.hpp b/boost/asio/ssl/detail/shutdown_op.hpp
index e98430621e..d55058af37 100644
--- a/boost/asio/ssl/detail/shutdown_op.hpp
+++ b/boost/asio/ssl/detail/shutdown_op.hpp
@@ -2,7 +2,7 @@
// ssl/detail/shutdown_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -42,7 +42,17 @@ public:
const boost::system::error_code& ec,
const std::size_t&) const
{
- handler(ec);
+ if (ec == boost::asio::error::eof)
+ {
+ // The engine only generates an eof when the shutdown notification has
+ // been received from the peer. This indicates that the shutdown has
+ // completed successfully, and thus need not be passed on to the handler.
+ handler(boost::system::error_code());
+ }
+ else
+ {
+ handler(ec);
+ }
}
};