From: Alan T. DeKok Date: Fri, 24 Aug 2012 15:30:18 +0000 (+0200) Subject: Track blocked / non-blocked state X-Git-Tag: release_2_2_0~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d65484f5328f94a6bc6a199d67f83e649b4bf366;p=thirdparty%2Ffreeradius-server.git Track blocked / non-blocked state If a REQUEST transitions from OK to STOP_PROCESSING during a module call, say WHICH module did this. --- diff --git a/src/main/modcall.c b/src/main/modcall.c index dfc3ba72edc..e79973eeb1d 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -275,9 +275,16 @@ static void safe_unlock(module_instance_t *instance) static int call_modsingle(int component, modsingle *sp, REQUEST *request) { int myresult; + int blocked; rad_assert(request != NULL); + /* + * If the request should stop, refuse to do anything. + */ + blocked = (request->master_state == REQUEST_STOP_PROCESSING); + if (blocked) return RLM_MODULE_NOOP; + RDEBUG3(" modsingle[%s]: calling %s (%s) for request %d", comp2str[component], sp->modinst->name, sp->modinst->entry->name, request->number); @@ -300,6 +307,15 @@ static int call_modsingle(int component, modsingle *sp, REQUEST *request) request->module = ""; safe_unlock(sp->modinst); + /* + * Wasn't blocked, and now is. Complain! + */ + blocked = (request->master_state == REQUEST_STOP_PROCESSING); + if (blocked) { + radlog(L_INFO, "WARNING: Module %s became blocked for request %u", + sp->modinst->entry->name, request->number); + } + fail: RDEBUG3(" modsingle[%s]: returned from %s (%s) for request %d", comp2str[component], sp->modinst->name,