- if (!policy_run_filter(query, NULL, NULL)) {
- policy_answer(pcy, "DUNNO");
+ const filter_t *filter;
+ if (config->entry_points[query->state] == -1) {
+ syslog(LOG_WARNING, "no filter defined for current protocol_state (%d)", query->state);
+ return false;
+ }
+ filter = array_ptr(config->filters, config->entry_points[query->state]);
+ while (true) {
+ const filter_hook_t *hook = filter_run(filter, query);
+ if (hook == NULL) {
+ syslog(LOG_WARNING, "request aborted");
+ return false;
+ } else if (hook->postfix) {
+ policy_answer(pcy, "%s", hook->value);
+ return true;
+ } else {
+ filter = array_ptr(config->filters, hook->filter_id);
+ }