]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: beast handle_connection() takes io_context
authorCasey Bodley <cbodley@redhat.com>
Tue, 23 Apr 2019 19:40:01 +0000 (15:40 -0400)
committerNathan Cutler <ncutler@suse.com>
Thu, 31 Oct 2019 14:48:45 +0000 (15:48 +0100)
as of boost 1.70, the socket no longer has a get_io_context(), so we
have to pass it in as an argument

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 064f142746ae97f54865069cdacf5aae2b1b14f6)

Conflicts:
src/rgw/rgw_asio_frontend.cc
- difference in handle_connection() argument list; not relevant to the change at
  hand

src/rgw/rgw_asio_frontend.cc

index 82e2a45da6c3abd6bf1a2bb4dd700dc1c57113c7..8750c5648f20af12b5734b81f3d6cecf4aec8681 100644 (file)
@@ -83,7 +83,8 @@ class StreamIO : public rgw::asio::ClientIO {
 using SharedMutex = ceph::async::SharedMutex<boost::asio::io_context::executor_type>;
 
 template <typename Stream>
-void handle_connection(RGWProcessEnv& env, Stream& stream,
+void handle_connection(boost::asio::io_context& context,
+                       RGWProcessEnv& env, Stream& stream,
                        parse_buffer& buffer, bool is_ssl,
                        SharedMutex& pause_mutex,
                        rgw::dmclock::Scheduler *scheduler,
@@ -160,7 +161,7 @@ void handle_connection(RGWProcessEnv& env, Stream& stream,
                                   rgw::io::add_conlen_controlling(
                                     &real_client))));
       RGWRestfulIO client(cct, &real_client_io);
-      auto y = optional_yield{socket.get_io_context(), yield};
+      auto y = optional_yield{context, yield};
       process_request(env.store, env.rest, &req, env.uri_prefix,
                       *env.auth_registry, &client, env.olog, y, scheduler);
     }
@@ -604,7 +605,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec)
           return;
         }
         buffer->consume(bytes);
-        handle_connection(env, stream, *buffer, true, pause_mutex,
+        handle_connection(context, env, stream, *buffer, true, pause_mutex,
                           scheduler.get(), ec, yield);
         if (!ec) {
           // ssl shutdown (ignoring errors)
@@ -622,7 +623,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec)
         auto c = connections.add(conn);
         auto buffer = std::make_unique<parse_buffer>();
         boost::system::error_code ec;
-        handle_connection(env, s, *buffer, false, pause_mutex,
+        handle_connection(context, env, s, *buffer, false, pause_mutex,
                           scheduler.get(), ec, yield);
         s.shutdown(tcp::socket::shutdown_both, ec);
       });