Fixed API calls not taking immediate effect, fixed UDP API not locking config

This commit is contained in:
Thulinma 2017-07-24 11:08:19 +02:00
parent 0f92664bb4
commit da37a33d47

View file

@ -202,6 +202,7 @@ void Controller::handleUDPAPI(void * np){
Request["minimal"] = true; Request["minimal"] = true;
JSON::Value Response; JSON::Value Response;
if (Request.isObject()){ if (Request.isObject()){
tthread::lock_guard<tthread::mutex> guard(configMutex);
handleAPICommands(Request, Response); handleAPICommands(Request, Response);
}else{ }else{
WARN_MSG("Invalid API command received over UDP: %s", uSock.data); WARN_MSG("Invalid API command received over UDP: %s", uSock.data);
@ -632,6 +633,7 @@ void Controller::handleAPICommands(JSON::Value & Request, JSON::Value & Response
} }
Controller::configChanged = true; Controller::writeConfig();
Controller::configChanged = false;
} }