From: Ilya Dryomov Date: Sat, 7 Dec 2024 11:37:29 +0000 (+0100) Subject: librbd/migration/HttpClient: propagate ec to handle_handshake() X-Git-Tag: testing/wip-vshankar-testing-20241219.063429-debug~49^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e305a5908bd7bd3f2fa906af8521aea989f0c0ca;p=ceph-ci.git librbd/migration/HttpClient: propagate ec to handle_handshake() Get rid of get_callback_adapter() which only obfuscates the error: handle_handshake: failed to complete SSL handshake: (337047686) Unknown error 337047686 vs handle_handshake: failed to complete SSL handshake: certificate verify failed (SSL routines, tls_process_server_certificate) Signed-off-by: Ilya Dryomov --- diff --git a/src/librbd/migration/HttpClient.cc b/src/librbd/migration/HttpClient.cc index b341bee709c..769187586e4 100644 --- a/src/librbd/migration/HttpClient.cc +++ b/src/librbd/migration/HttpClient.cc @@ -739,19 +739,20 @@ private: // Perform the SSL/TLS handshake m_stream.async_handshake( boost::asio::ssl::stream_base::client, - asio::util::get_callback_adapter( - [this, on_finish](int r) { handle_handshake(r, on_finish); })); + [this, on_finish](boost::system::error_code ec) { + handle_handshake(ec, on_finish); + }); } - void handle_handshake(int r, Context* on_finish) { + void handle_handshake(boost::system::error_code ec, Context* on_finish) { auto http_client = this->m_http_client; auto cct = http_client->m_cct; - ldout(cct, 15) << "r=" << r << dendl; + ldout(cct, 15) << "ec=" << ec.what() << dendl; - if (r < 0) { - lderr(cct) << "failed to complete handshake: " << cpp_strerror(r) + if (ec) { + lderr(cct) << "failed to complete SSL handshake: " << ec.message() << dendl; - on_finish->complete(r); + on_finish->complete(-ec.value()); return; }