]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/beast: enablment of SSL session-id reuse speedup mechanism 56119/head
authorMark Kogan <mkogan@redhat.com>
Tue, 5 Mar 2024 14:48:56 +0000 (16:48 +0200)
committerMark Kogan <mkogan@redhat.com>
Sun, 12 May 2024 09:07:19 +0000 (12:07 +0300)
Enable the OpenSSL session-id reuse acceleration mechanism that is described in:

https://www.openssl.org/docs/man1.0.2/man3/SSL_CTX_set_session_id_context.html
SSL_CTX_set_session_id_context, SSL_set_session_id_context - set context
within which session can be reused (server side only)

Fixes: https://tracker.ceph.com/issues/64719
Signed-off-by: Mark Kogan <mkogan@redhat.com>
(cherry picked from commit 6fb4c5d0c0694c9cfdbf0ed729d9f95886a0673f)

src/rgw/rgw_asio_frontend.cc

index 0e2fec30aa6a31530d310134718cf269a1bbe4d6..e328285cf85ab6891b3e4a42e2ac21a17a3c68c1 100644 (file)
@@ -481,7 +481,7 @@ unsigned short parse_port(const char *input, boost::system::error_code& ec)
   }
   return port;
 }
-       
+
 tcp::endpoint parse_endpoint(boost::asio::string_view input,
                              unsigned short default_port,
                              boost::system::error_code& ec)
@@ -1033,10 +1033,12 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec)
         handle_connection(context, env, stream, timeout, header_limit,
                           conn->buffer, true, pause_mutex, scheduler.get(),
                           ec, yield);
-        if (!ec) {
+
+        if (!ec || ec == http::error::end_of_stream) {
           // ssl shutdown (ignoring errors)
           stream.async_shutdown(yield[ec]);
         }
+
         conn->socket.shutdown(tcp::socket::shutdown_both, ec);
       }, make_stack_allocator());
   } else {