From: Oguzhan Ozmen Date: Wed, 24 Jun 2026 14:34:04 +0000 (+0000) Subject: rgw/beast: (non-functional change) add size method to ConnectionList X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=179b873e9bf2826a5db9fef50e76c2bef3d47438;p=ceph.git rgw/beast: (non-functional change) add size method to ConnectionList This is meant to be used in unittesting. Signed-off-by: Oguzhan Ozmen --- diff --git a/src/rgw/rgw_asio_frontend_connection.h b/src/rgw/rgw_asio_frontend_connection.h index 18e46269bb83..d06ef98849a2 100644 --- a/src/rgw/rgw_asio_frontend_connection.h +++ b/src/rgw/rgw_asio_frontend_connection.h @@ -35,7 +35,7 @@ struct Connection : boost::intrusive::list_base_hook<>, class ConnectionList { using List = boost::intrusive::list; List connections; - std::mutex mutex; + mutable std::mutex mutex; void remove(Connection& c) { std::lock_guard lock{mutex}; @@ -56,6 +56,10 @@ class ConnectionList { connections.push_back(conn); return Guard{this, &conn}; } + size_t size() const { + std::lock_guard lock{mutex}; + return connections.size(); + } void close(boost::system::error_code& ec) { std::lock_guard lock{mutex}; for (auto& conn : connections) {