MCPcopy Create free account
hub / github.com/apache/trafficserver / add_rule

Method add_rule

plugins/header_rewrite/header_rewrite.cc:126–140  ·  view source on GitHub ↗

Helper function to add a rule to the rulesets

Source from the content-addressed store, hash-verified

124
125// Helper function to add a rule to the rulesets
126bool
127RulesConfig::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.

Callers

nothing calls this directly

Calls 4

TSHttpHookNameLookupFunction · 0.85
has_operatorMethod · 0.80
get_hookMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected