]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/beast: (non-functional change) add size method to ConnectionList
authorOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 24 Jun 2026 14:34:04 +0000 (14:34 +0000)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 24 Jun 2026 19:02:09 +0000 (19:02 +0000)
This is meant to be used in unittesting.

Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
src/rgw/rgw_asio_frontend_connection.h

index 18e46269bb83e6661e78a2a491a457496b7f80b9..d06ef98849a27010b51e98531c502c50a2254f25 100644 (file)
@@ -35,7 +35,7 @@ struct Connection : boost::intrusive::list_base_hook<>,
 class ConnectionList {
   using List = boost::intrusive::list<Connection>;
   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) {