static unlang_t *compile_redundant(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
{
- char const *name2;
unlang_t *c;
static unlang_ext_t const redundant_ext = {
if (!c) return NULL;
/*
- * "redundant" is just "group" with different default actions.
- *
- * Named redundant sections are only allowed in the
- * "instantiate" section.
- */
- name2 = cf_section_name2(cs);
-
- /*
- * But only outside of the "instantiate" section.
- * For backwards compatibility.
+ * We no longer care if "redundant" sections have a name. If they do, it's ignored.
*/
- if (name2 &&
- (strcmp(cf_section_name1(cf_item_to_section(cf_parent(cs))), "instantiate") != 0)) {
- cf_log_err(cs, "'redundant' sections cannot have a name");
- return NULL;
- }
return c;
}
return c;
}
-/** Load a named module from "instantiate" or "policy".
+/** Load a named module from the virtual module list, or from the "policy" subsection.
*
* If it's "foo.method", look for "foo", and return "method" as the method
* we wish to use, instead of the input component.
}
/*
- * Look for "foo" in the "instantiate" section. If we
- * find it, AND there's no method name, we've found the
- * right thing.
+ * Look for "foo" as a virtual server. If we find it,
+ * AND there's no method name, we've found the right
+ * thing.
+ *
+ * Found "foo". Load it as "foo", or "foo.method".
*
* Return it to the caller, with the updated method.
*/
- cs = cf_section_find(conf_root, "instantiate", NULL);
- if (cs) {
- /*
- * Found "foo". Load it as "foo", or "foo.method".
- */
- subcs = cf_section_find(cs, CF_IDENT_ANY, virtual_name);
- if (subcs) {
- *pcomponent = method;
- goto check_for_loop;
- }
+ subcs = module_by_name_virtual(virtual_name);
+ if (subcs) {
+ *pcomponent = method;
+ goto check_for_loop;
}
/*
if (realname != name) {
cf_log_warn(ci, "Ignoring \"%s\" as the \"%s\" module is not enabled.", name, realname);
return UNLANG_IGNORE;
-
}
/*