MXS-1220: Only process updated server parameters

The alteration function is only called when the value of a parameter
changes. This removes some of the redundant logging that was caused by
calling the alteration function with the same values.
This commit is contained in:
Markus Mäkelä
2017-04-21 10:11:12 +03:00
committed by Markus Mäkelä
parent 84d085ef39
commit bab7957952
2 changed files with 46 additions and 30 deletions

View File

@ -14,12 +14,13 @@
#include <maxscale/cppdefs.hh>
#include <string>
#include <sstream>
#include <string>
#include <maxscale/alloc.h>
#include <maxscale/debug.h>
#include <maxscale/jansson.h>
#include <maxscale/utils.hh>
#include <maxscale/alloc.h>
namespace maxscale
{
@ -83,29 +84,35 @@ static inline std::string json_to_string(json_t* json)
{
std::stringstream ss;
if (json_is_string(json))
switch (json_typeof(json))
{
case JSON_STRING:
ss << json_string_value(json);
}
else if (json_is_boolean(json))
{
ss << (json_boolean_value(json) ? "true" : "false");
}
else if (json_is_real(json))
{
ss << json_real_value(json);
}
else if (json_is_number(json))
{
ss << json_number_value(json);
}
else if (json_is_integer(json))
{
break;
case JSON_INTEGER:
ss << json_integer_value(json);
}
else if (json_is_null(json))
{
ss << "";
break;
case JSON_REAL:
ss << json_real_value(json);
break;
case JSON_TRUE:
ss << "true";
break;
case JSON_FALSE:
ss << "false";
break;
case JSON_NULL:
break;
default:
ss_dassert(false);
break;
}
return ss.str();