Take static module capabilities into use

The static module capabilities are now used to query the capabilities of
filters and routers. The new RCAP_TYPE_NOAUTH capability is also taken
into use. These changes removes the need for the `is_internal_service`
function.
This commit is contained in:
Markus Mäkelä
2017-03-20 10:44:05 +02:00
parent 1736aca7f7
commit 039f6e3487
29 changed files with 60 additions and 88 deletions

View File

@ -142,7 +142,10 @@ SERVICE* service_alloc(const char *name, const char *router)
return NULL;
}
service->capabilities = 0;
const MXS_MODULE* module = get_module(my_router, MODULE_ROUTER);
ss_dassert(module);
service->capabilities = module->module_capabilities;
service->client_count = 0;
service->n_dbref = 0;
service->name = my_name;
@ -1239,6 +1242,9 @@ serviceSetFilters(SERVICE *service, char *filters)
{
if (filter_load(flist[n - 1]))
{
const MXS_MODULE* module = get_module(flist[n - 1]->module, MODULE_FILTER);
ss_dassert(module);
capabilities |= module->module_capabilities;
capabilities |= flist[n - 1]->obj->getCapabilities(flist[n - 1]->filter);
}
else