X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=common%2Ftr_config_internal.c;fp=common%2Ftr_config_internal.c;h=82a57e2abc26c99fe34b227861898d43eb72f338;hb=44c8ebb43831dbda399c34980c410565af60dcf2;hp=85cd69cc4b8fd5a04c505e080039de9040ecd7a5;hpb=97e8a584d23eb9ceb60a1f747e8d74e668860113;p=trust_router.git diff --git a/common/tr_config_internal.c b/common/tr_config_internal.c index 85cd69c..82a57e2 100644 --- a/common/tr_config_internal.c +++ b/common/tr_config_internal.c @@ -146,7 +146,7 @@ do { \ */ TR_CFG_RC tr_cfg_parse_internal(TR_CFG *trc, json_t *jint) { - json_t *jlog = NULL; + json_t *jtmp = NULL; const char *s = NULL; if ((!trc) || (!jint)) @@ -175,20 +175,26 @@ TR_CFG_RC tr_cfg_parse_internal(TR_CFG *trc, json_t *jint) NOPARSE_UNLESS(tr_cfg_parse_unsigned(jint, "tid_response_numerator", &(trc->internal->tid_resp_numer))); NOPARSE_UNLESS(tr_cfg_parse_unsigned(jint, "tid_response_denominator", &(trc->internal->tid_resp_denom))); - if (NULL != (jlog = json_object_get(jint, "logging"))) { - NOPARSE_UNLESS(tr_cfg_parse_string(jlog, "log_threshold", &s)); + /* Parse the logging section */ + if (NULL != (jtmp = json_object_get(jint, "logging"))) { + NOPARSE_UNLESS(tr_cfg_parse_string(jtmp, "log_threshold", &s)); if (s) { trc->internal->log_threshold = str2sev(s); talloc_free((void *) s); } - NOPARSE_UNLESS(tr_cfg_parse_string(jlog, "console_threshold", &s)); + NOPARSE_UNLESS(tr_cfg_parse_string(jtmp, "console_threshold", &s)); if (s) { trc->internal->console_threshold = str2sev(s); talloc_free((void *) s); } } + /* Parse the monitoring section */ + if (NULL != (jtmp = json_object_get(jint, "monitoring"))) { + NOPARSE_UNLESS(tr_cfg_parse_unsigned(jtmp, "port", &(trc->internal->monitoring_port))); + } + tr_debug("tr_cfg_parse_internal: Internal config parsed."); return TR_CFG_SUCCESS; }