]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: beast frontend checks for local_endpoint() errors 54167/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 6 Oct 2022 17:22:35 +0000 (13:22 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 24 Oct 2023 14:25:53 +0000 (10:25 -0400)
socket.local_endpoint() throws on error. use the error_code overload
instead and return on failure

Fixes: https://tracker.ceph.com/issues/57784
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 60af907c91210f60d0009318b8ca2ccd87941bb9)

src/rgw/rgw_asio_frontend.cc

index be5af0a70d396f7f70843ebbe6857ff3781e00bc..cc60ae7afeaf1716638be439207c6b33c828a8ef 100644 (file)
@@ -256,10 +256,14 @@ void handle_connection(boost::asio::io_context& context,
         ldout(cct, 1) << "failed to connect client: " << ec.message() << dendl;
         return;
       }
+      const auto& local_endpoint = socket.local_endpoint(ec);
+      if (ec) {
+        ldout(cct, 1) << "failed to connect client: " << ec.message() << dendl;
+        return;
+      }
 
       StreamIO real_client{cct, stream, timeout, parser, yield, buffer,
-                           is_ssl, socket.local_endpoint(),
-                           remote_endpoint};
+                           is_ssl, local_endpoint, remote_endpoint};
 
       auto real_client_io = rgw::io::add_reordering(
                               rgw::io::add_buffering(cct,