From: Abhishek L Date: Wed, 28 Aug 2019 15:33:24 +0000 (+0200) Subject: Merge pull request #29967 from theanalyst/rgw/beast-endpoint-fix X-Git-Tag: v15.1.0~1741 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6171399fdedd928b4249d135b4036e3de25079aa;p=ceph.git Merge pull request #29967 from theanalyst/rgw/beast-endpoint-fix rgw: asio: check the remote endpoint before processing requests Reviewed-By: Casey Bodley --- 6171399fdedd928b4249d135b4036e3de25079aa diff --cc src/rgw/rgw_asio_frontend.cc index 82dec1e7ecb9,ec74f10a9878..121790acc215 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@@ -143,12 -143,18 +143,18 @@@ void handle_connection(boost::asio::io_ } // process the request - RGWRequest req{env.store->get_new_req_id()}; + RGWRequest req{env.store->getRados()->get_new_req_id()}; auto& socket = stream.lowest_layer(); + const auto& remote_endpoint = socket.remote_endpoint(ec); + if (ec) { + ldout(cct, 1) << "failed to connect client: " << ec.message() << dendl; + return; + } + StreamIO real_client{cct, stream, parser, yield, buffer, is_ssl, socket.local_endpoint(), - socket.remote_endpoint()}; + remote_endpoint}; auto real_client_io = rgw::io::add_reordering( rgw::io::add_buffering(cct,