ConstElementPtr
ControlledDhcpv4Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
+ // pause dhcp service when reloading libraries
+ MultiThreadingCriticalSection cs;
/// @todo delete any stored CalloutHandles referring to the old libraries
/// Get list of currently loaded libraries and reload them.
HookLibsCollection loaded = HooksManager::getLibraryInfo();
return (result);
}
+ // disable multi-threading (it will be applied by new configuration)
+ MultiThreadingMgr::instance().apply(false, 0, 0);
+
// We are starting the configuration process so we should remove any
// staging configuration that has been created during previous
// configuration attempts.
if (!srv) {
ConstElementPtr no_srv = isc::config::createAnswer(1,
- "Server object not initialized, so can't process command '" +
- command + "', arguments: '" + txt + "'.");
+ "Server object not initialized, so can't process command '" +
+ command + "', arguments: '" + txt + "'.");
return (no_srv);
}
} else if (command == "status-get") {
return (srv->commandStatusGetHandler(command, args));
}
- ConstElementPtr answer = isc::config::createAnswer(1,
- "Unrecognized command:" + command);
- return (answer);
+
+ return (isc::config::createAnswer(1, "Unrecognized command:"
+ + command));
+
} catch (const Exception& ex) {
return (isc::config::createAnswer(1, "Error while processing command '"
+ command + "':" + ex.what() +
}
ControlledDhcpv6Srv::getInstance()->shutdownServer(exit_value);
- return(createAnswer(CONTROL_RESULT_SUCCESS, "Shutting down."));
+ return (createAnswer(CONTROL_RESULT_SUCCESS, "Shutting down."));
}
ConstElementPtr
ControlledDhcpv6Srv::commandLibReloadHandler(const string&, ConstElementPtr) {
+ // pause dhcp service when reloading libraries
+ MultiThreadingCriticalSection cs;
/// @todo delete any stored CalloutHandles referring to the old libraries
/// Get list of currently loaded libraries and reload them.
HookLibsCollection loaded = HooksManager::getLibraryInfo();
return (result);
}
+ // disable multi-threading (it will be applied by new configuration)
+ MultiThreadingMgr::instance().apply(false, 0, 0);
+
// We are starting the configuration process so we should remove any
// staging configuration that has been created during previous
// configuration attempts.
if (!srv) {
ConstElementPtr no_srv = isc::config::createAnswer(1,
- "Server object not initialized, can't process command '" +
- command + "', arguments: '" + txt + "'.");
+ "Server object not initialized, so can't process command '" +
+ command + "', arguments: '" + txt + "'.");
return (no_srv);
}
} catch (const Exception& ex) {
return (isc::config::createAnswer(1, "Error while processing command '"
- + command + "':" + ex.what()));
+ + command + "':" + ex.what() +
+ ", params: '" + txt + "'"));
}
}