]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: beast frontend checks for local_endpoint() errors
authorCasey Bodley <cbodley@redhat.com>
Thu, 6 Oct 2022 17:22:35 +0000 (13:22 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 6 Oct 2022 17:24:04 +0000 (13:24 -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>
src/rgw/rgw_asio_frontend.cc

index 4b4a8175192fbb9c2fdcc8d54f1866bd61dae2bd..6763b28e1b9c44f560078b4ba6e359b30156eb04 100644 (file)
@@ -247,10 +247,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,