Helper function to add a rule to the rulesets
| 124 | |
| 125 | // Helper function to add a rule to the rulesets |
| 126 | bool |
| 127 | RulesConfig::add_rule(RuleSet *rule) |
| 128 | { |
| 129 | if (rule && rule->has_operator()) { |
| 130 | Dbg(dbg_ctl, " Adding rule to hook=%s", TSHttpHookNameLookup(rule->get_hook())); |
| 131 | if (nullptr == _rules[rule->get_hook()]) { |
| 132 | _rules[rule->get_hook()] = rule; |
| 133 | } else { |
| 134 | _rules[rule->get_hook()]->append(rule); |
| 135 | } |
| 136 | return true; |
| 137 | } |
| 138 | |
| 139 | return false; |
| 140 | } |
| 141 | |
| 142 | /////////////////////////////////////////////////////////////////////////////// |
| 143 | // Config parser, use to parse both the global, and per-remap, configurations. |
nothing calls this directly
no test coverage detected