From 4d98819f352919aee55454a5c3ac7779be7636bb Mon Sep 17 00:00:00 2001 From: Emagi Date: Fri, 6 Dec 2024 09:52:40 -0500 Subject: [PATCH] Update HTTPSClientPool.cpp --- source/WorldServer/Web/HTTPSClientPool.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/WorldServer/Web/HTTPSClientPool.cpp b/source/WorldServer/Web/HTTPSClientPool.cpp index 12dbc69..036c8b3 100644 --- a/source/WorldServer/Web/HTTPSClientPool.cpp +++ b/source/WorldServer/Web/HTTPSClientPool.cpp @@ -572,19 +572,21 @@ void HTTPSClientPool::pollPeerHealth(const std::string& server, const std::strin } // Process Clients if (json_tree.find("Clients") != json_tree.not_found()) { - const auto& clients_subtree = json_tree.get_child("Clients"); - - boost::property_tree::ptree clients_copy = clients_subtree; + // Create a new ptree to preserve the "Zones" key + boost::property_tree::ptree clients_copy; + // Copy the "Zones" node to zones_copy to preserve its key + clients_copy.put_child("Clients", json_tree.get_child("Clients")); peer_manager.updateClientTree(id, clients_copy); } // Process Zones if (json_tree.find("Zones") != json_tree.not_found()) { - const auto& zones_subtree = json_tree.get_child("Zones"); - - boost::property_tree::ptree zones_copy = zones_subtree; + // Create a new ptree to preserve the "Zones" key + boost::property_tree::ptree zones_copy; + // Copy the "Zones" node to zones_copy to preserve its key + zones_copy.put_child("Zones", json_tree.get_child("Zones")); peer_manager.updateZoneTree(id, zones_copy); }