mirror of
https://github.com/boostorg/asio.git
synced 2026-01-19 04:02:09 +00:00
Ensure sync SSL shutdown remaps error::eof as async_shutdown does.
This commit is contained in:
@@ -52,6 +52,10 @@ public:
|
||||
boost::asio::buffer_sequence_end(buffers_));
|
||||
}
|
||||
|
||||
void complete_sync(boost::system::error_code&) const
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
void call_handler(Handler& handler,
|
||||
const boost::system::error_code& ec,
|
||||
|
||||
@@ -47,6 +47,10 @@ public:
|
||||
return eng.handshake(type_, ec);
|
||||
}
|
||||
|
||||
void complete_sync(boost::system::error_code&) const
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
void call_handler(Handler& handler,
|
||||
const boost::system::error_code& ec,
|
||||
|
||||
@@ -79,18 +79,21 @@ std::size_t io(Stream& next_layer, stream_core& core,
|
||||
|
||||
// Operation is complete. Return result to caller.
|
||||
core.engine_.map_error_code(ec);
|
||||
op.complete_sync(ec);
|
||||
return bytes_transferred;
|
||||
|
||||
default:
|
||||
|
||||
// Operation is complete. Return result to caller.
|
||||
core.engine_.map_error_code(ec);
|
||||
op.complete_sync(ec);
|
||||
return bytes_transferred;
|
||||
|
||||
} while (!ec);
|
||||
|
||||
// Operation failed. Return result to caller.
|
||||
core.engine_.map_error_code(ec);
|
||||
op.complete_sync(ec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ public:
|
||||
return eng.read(buffer, ec, bytes_transferred);
|
||||
}
|
||||
|
||||
void complete_sync(boost::system::error_code&) const
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
void call_handler(Handler& handler,
|
||||
const boost::system::error_code& ec,
|
||||
|
||||
@@ -42,6 +42,17 @@ public:
|
||||
return eng.shutdown(ec);
|
||||
}
|
||||
|
||||
void complete_sync(boost::system::error_code& ec) const
|
||||
{
|
||||
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 returned to the caller.
|
||||
ec = boost::system::error_code();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
void call_handler(Handler& handler,
|
||||
const boost::system::error_code& ec,
|
||||
|
||||
@@ -56,6 +56,10 @@ public:
|
||||
return eng.write(buffer, ec, bytes_transferred);
|
||||
}
|
||||
|
||||
void complete_sync(boost::system::error_code&) const
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
void call_handler(Handler& handler,
|
||||
const boost::system::error_code& ec,
|
||||
|
||||
Reference in New Issue
Block a user