X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tr%2Ftr_mon.c;fp=tr%2Ftr_mon.c;h=84ab353d81c3e740d6acb37288d5dd7d24780bc3;hb=b9adb7a0845273cab35025a347c7213553aa154a;hp=8138198cfed341ce114e9afad989b018a1ce0f44;hpb=9587241c537439f2efa70b427b5b6a48a288126e;p=trust_router.git diff --git a/tr/tr_mon.c b/tr/tr_mon.c index 8138198..84ab353 100644 --- a/tr/tr_mon.c +++ b/tr/tr_mon.c @@ -96,9 +96,8 @@ static int tr_mons_auth_handler(gss_name_t client_name, TR_NAME *gss_name, void { struct tr_mons_event_cookie *cookie=talloc_get_type_abort(cookie_in, struct tr_mons_event_cookie); MONS_INSTANCE *mons = cookie->mons; - TR_CFG_MGR *cfg_mgr = cookie->cfg_mgr; - if ((!client_name) || (!gss_name) || (!mons) || (!cfg_mgr)) { + if ((!client_name) || (!gss_name) || (!mons)) { tr_debug("tr_mons_gss_handler: Bad parameters."); return -1; } @@ -145,6 +144,12 @@ int tr_mons_event_init(struct event_base *base, goto cleanup; } + if (cfg_mgr->active->internal->monitoring_port == 0) { + tr_notice("tr_mons_event_init: monitoring is disabled, not enabling events or opening sockets"); + retval = 0; + goto cleanup; + } + /* Create the cookie for callbacks. We'll put it in the mons context, so it will * be cleaned up when mons is freed by talloc_free. */ cookie=talloc(tmp_ctx, struct tr_mons_event_cookie);