]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/ssl/detail/shutdown_op.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / asio / ssl / detail / shutdown_op.hpp
index e98430621ea5def180f96795757f1cb338a8cacb..d55058af3749dd4e65f20f305cd293b7983cd473 100644 (file)
@@ -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);
+    }
   }
 };