.arg(CfgMgr::instance().getStagingCfg()->
getConfigSummary(SrvConfig::CFGSEL_ALL4));
- // Also calculate SHA256 hash of the config that was just set and append it to the response.
- ElementPtr config = CfgMgr::instance().getCurrentCfg()->toElement();
+ // Also calculate SHA256 hash of the config that was just set and
+ // append it to the response.
+ ConstElementPtr config = CfgMgr::instance().getStagingCfg()->toElement();
string hash = BaseCommandMgr::getHash(config);
ElementPtr hash_map = Element::createMap();
hash_map->set("hash", Element::create(hash));
.arg(CfgMgr::instance().getStagingCfg()->
getConfigSummary(SrvConfig::CFGSEL_ALL6));
- // Also calculate SHA256 hash of the config that was just set and append it to the response.
- ElementPtr config = CfgMgr::instance().getCurrentCfg()->toElement();
+ // Also calculate SHA256 hash of the config that was just set and
+ // append it to the response.
+ ConstElementPtr config = CfgMgr::instance().getStagingCfg()->toElement();
string hash = BaseCommandMgr::getHash(config);
ElementPtr hash_map = Element::createMap();
hash_map->set("hash", Element::create(hash));
-// Copyright (C) 2017-2022 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
}
std::string
-BaseCommandMgr::getHash(isc::data::ElementPtr& config) {
+BaseCommandMgr::getHash(const isc::data::ConstElementPtr& config) {
// First, get the string representation.
std::string config_txt = config->str();
-// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @brief returns a hash of a given Element structure
///
- /// The hash is currently implemented as SHA256 on the string represenation of the structure.
+ /// The hash is currently implemented as SHA256 on the string
+ // representation of the structure.
///
/// @param config typically full config, but hash can be calculated on any structure
- /// @return string representation
- static std::string getHash(isc::data::ElementPtr& config);
+ /// @return hash of string representation
+ static std::string getHash(const isc::data::ConstElementPtr& config);
protected: