pthread_mutex_unlock(instance->mutex);
}
-static rlm_rcode_t CC_HINT(nonnull) unlang_module(rlm_components_t component, modsingle *sp, REQUEST *request)
+static rlm_rcode_t CC_HINT(nonnull) unlang_module(REQUEST *request, modsingle *sp)
{
int blocked;
if (blocked) return RLM_MODULE_NOOP;
RDEBUG3("modsingle[%s]: calling %s (%s) for request %" PRIu64,
- comp2str[component], sp->modinst->name,
+ sp->method, sp->modinst->name,
sp->modinst->module->name, request->number);
if (sp->modinst->force) {
request->module = sp->modinst->name;
safe_lock(sp->modinst);
- request->rcode = sp->modinst->module->methods[component](sp->modinst->data, request);
+ request->rcode = sp->function(sp->modinst->data, request);
safe_unlock(sp->modinst);
request->module = NULL;
fail:
RDEBUG3("modsingle[%s]: returned from %s (%s) for request %" PRIu64,
- comp2str[component], sp->modinst->name,
+ sp->method, sp->modinst->name,
sp->modinst->module->name, request->number);
return request->rcode;
*/
sp = mod_callabletosingle(c);
- *presult = unlang_module(c->method, sp, request);
+ *presult = unlang_module(request, sp);
*priority = c->actions[*presult];
RDEBUG2("%s (%s)", c->name ? c->name : "",
}
-static modcallable *compile_csingle(modcallable *parent, rlm_components_t component, CONF_ITEM *ci, module_instance_t *this, grouptype_t grouptype, char const *realname)
+static modcallable *compile_module(modcallable *parent, rlm_components_t component, CONF_ITEM *ci, module_instance_t *this, grouptype_t grouptype, char const *realname)
{
modcallable *c;
modsingle *single;
single = talloc_zero(parent, modsingle);
single->modinst = this;
+ single->function = this->module->methods[component];
+ single->method = comp2str[component];
c = mod_singletocallable(single);
c->parent = parent;
this = module_instantiate_method(modules, realname, &method);
if (this) {
*modname = this->module->name;
- return compile_csingle(parent, method, ci, this, parent_grouptype, realname);
+ return compile_module(parent, method, ci, this, parent_grouptype, realname);
}
/*