]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/migration/HttpClient: drop SslHttpSession::m_ssl_enabled
authorIlya Dryomov <idryomov@gmail.com>
Sat, 7 Dec 2024 12:52:41 +0000 (13:52 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 16 Dec 2024 08:51:23 +0000 (09:51 +0100)
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)

src/librbd/migration/HttpClient.cc

index 4d94b1eaf787ec36c85ac237132816b7c75ff497..b341bee709c3a9c55e58f19987afa05731121b36 100644 (file)
@@ -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<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;
@@ -761,7 +755,6 @@ private:
       return;
     }
 
-    m_ssl_enabled = true;
     on_finish->complete(0);
   }