From: Mark Kogan Date: Tue, 30 Apr 2024 11:20:54 +0000 (+0000) Subject: rgw/beast: fix crash observed in SSL stream.async_shutdown() X-Git-Tag: v19.1.1~297^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bff3d078d18fa978c9a457bae09b3585250003db;p=ceph.git rgw/beast: fix crash observed in SSL stream.async_shutdown() Fixes: https://tracker.ceph.com/issues/65664 Signed-off-by: Mark Kogan (cherry picked from commit bd1a0064b4915e3b27292dc49dbc5e81ef6fc973) --- diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index 49b69614b0abb..8c64570287dae 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -1043,9 +1043,11 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec) conn->buffer, true, pause_mutex, scheduler.get(), uri_prefix, ec, yield); - // ssl shutdown (ignoring errors) - stream.async_shutdown(yield[ec]); - + if (!ec || ec == http::error::end_of_stream) { + // ssl shutdown (ignoring errors) + stream.async_shutdown(yield[ec]); + } + conn->socket.shutdown(tcp::socket::shutdown_both, ec); }, make_stack_allocator()); } else {