From: Alan T. DeKok Date: Fri, 24 Aug 2012 15:30:18 +0000 (+0200) Subject: Track blocked / non-blocked state X-Git-Tag: release_3_0_0_beta0~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e01eeb7cd1d1c5cb8b87440648fa63ad420d069;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 a224ba60bbf..eeb0eaa7520 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -276,9 +276,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); @@ -301,6 +308,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,