The remaining callers of disconnect() call it only when m_ssl_enabled
is set to true (i.e. after the handshake is completed):
- shut_down(), in STATE_READY
- maybe_finalize_reset(), very shortly after transitioning out of
STATE_READY as part of performing a reset
- advance_state(), on a transition to STATE_READY that is intercepted
by a previously delayed shut down
m_ssl_enabled isn't used outside of disconnect() and on top of that
is never cleared.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit
8566224e9406abca42925f8045077141c2724bed)
auto cct = http_client->m_cct;
ldout(cct, 15) << dendl;
- if (!m_ssl_enabled) {
- on_finish->complete(0);
- return;
- }
-
m_stream.async_shutdown(
asio::util::get_callback_adapter([this, on_finish](int r) {
shutdown(r, on_finish); }));
private:
boost::beast::ssl_stream<boost::beast::tcp_stream> m_stream;
- bool m_ssl_enabled = false;
void handle_connect(int r, Context* on_finish) {
auto http_client = this->m_http_client;
return;
}
- m_ssl_enabled = true;
on_finish->complete(0);
}