From: Ilya Dryomov Date: Sat, 7 Dec 2024 12:52:41 +0000 (+0100) Subject: librbd/migration/HttpClient: drop SslHttpSession::m_ssl_enabled X-Git-Tag: v19.2.1~15^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4e1a80584c4626c9dc31bbb66eb0ae0149732cab;p=ceph.git librbd/migration/HttpClient: drop SslHttpSession::m_ssl_enabled 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 (cherry picked from commit 8566224e9406abca42925f8045077141c2724bed) --- diff --git a/src/librbd/migration/HttpClient.cc b/src/librbd/migration/HttpClient.cc index 4d94b1eaf787e..b341bee709c3a 100644 --- a/src/librbd/migration/HttpClient.cc +++ b/src/librbd/migration/HttpClient.cc @@ -663,11 +663,6 @@ protected: 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); })); @@ -686,7 +681,6 @@ protected: private: boost::beast::ssl_stream m_stream; - bool m_ssl_enabled = false; void handle_connect(int r, Context* on_finish) { auto http_client = this->m_http_client; @@ -761,7 +755,6 @@ private: return; } - m_ssl_enabled = true; on_finish->complete(0); }