2273. [func]* fdupont
The RBAC (role-based access control) hook library was
extended to support the new HTTP/HTTPS control socket
- of Kea servers. Its name changed to "libdhcp_rbac.so".
- "libca_rbac.so" is now a symbolic link to it.
+ of Kea servers. Note its name changed too from
+ "libca_rbac.so" to "libdhcp_rbac.so".
(Gitlab #3483)
2272. [perf] fdupont
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND, DHCP4_CONFIG_START)
.arg(server.redactConfig(config_set)->str());
+ if (check_only) {
+ MultiThreadingMgr::instance().setTestMode(true);
+ }
+
auto answer = processDhcp4Config(config_set);
int status_code = CONTROL_RESULT_SUCCESS;
ControlSocketsParser parser;
parser.parse(*srv_config, control_sockets);
}
+
ConstElementPtr multi_threading = mutable_cfg->get("multi-threading");
if (multi_threading) {
parameter_name = "multi-threading";
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_COMMAND, DHCP6_CONFIG_START)
.arg(server.redactConfig(config_set)->str());
+ if (check_only) {
+ MultiThreadingMgr::instance().setTestMode(true);
+ }
+
auto answer = processDhcp6Config(config_set);
int status_code = CONTROL_RESULT_SUCCESS;
// configuration. This will add created subnets and option values into
// the server's configuration.
// This operation should be exception safe but let's make sure.
- if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
+ if (status_code == CONTROL_RESULT_SUCCESS && !check_only) {
try {
// Setup the command channel.
void
CmdHttpListener::start() {
+ if (MultiThreadingMgr::instance().isTestMode()) {
+ return;
+ }
// We must be in multi-threading mode.
if (!MultiThreadingMgr::instance().getMode()) {
isc_throw(InvalidOperation, "CmdHttpListener cannot be started"
void
MtTcpListenerMgr::start() {
+ if (MultiThreadingMgr::instance().isTestMode()) {
+ return;
+ }
// We must be in multi-threading mode.
if (!MultiThreadingMgr::instance().getMode()) {
isc_throw(InvalidOperation, "MtTcpListenerMgr cannot be started"
namespace util {
MultiThreadingMgr::MultiThreadingMgr()
- : enabled_(false), critical_section_count_(0), thread_pool_size_(0) {
+ : enabled_(false), test_mode_(false), critical_section_count_(0),
+ thread_pool_size_(0) {
}
MultiThreadingMgr::~MultiThreadingMgr() {
/// @param enabled The new mode.
void setMode(bool enabled);
+ /// @brief Sets or clears the test mode for @c MultiThreadingMgr.
+ ///
+ /// @param test_mode A flag which indicates that the @c MultiThreadingMgr is
+ /// in the test mode (if true), or not (if false).
+ void setTestMode(const bool test_mode) {
+ test_mode_ = test_mode;
+ }
+
+ /// @brief Checks if the @c MultiThreadingMgr is in the test mode.
+ ///
+ /// @return true if the @c MultiThreadingMgr is in the test mode, false
+ /// otherwise.
+ bool isTestMode() const {
+ return (test_mode_);
+ }
+
/// @brief Enter critical section.
///
/// When entering @ref MultiThreadingCriticalSection, increment internal
/// otherwise.
bool enabled_;
+ /// @brief Indicates if the @c MultiThreadingMgr is in the test mode.
+ bool test_mode_;
+
/// @brief The critical section count.
///
/// In case the configuration is applied within a