]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #29967 from theanalyst/rgw/beast-endpoint-fix
authorAbhishek L <abhishek@suse.com>
Wed, 28 Aug 2019 15:33:24 +0000 (17:33 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Aug 2019 15:33:24 +0000 (17:33 +0200)
rgw: asio: check the remote endpoint before processing requests

Reviewed-By: Casey Bodley <cbodley@redhat.com>
1  2 
src/rgw/rgw_asio_frontend.cc

index 82dec1e7ecb9f0f04ba172ed96d9acc3314c9705,ec74f10a9878f6ceefec35de74854490ec61214e..121790acc215524819e51740c9368b9f018dd967
@@@ -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,