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

Method initialize

plugins/header_rewrite/condition.cc:69–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void
70Condition::initialize(Parser &p)
71{
72 Statement::initialize(p);
73
74 if (p.mod_exist("OR")) {
75 if (p.mod_exist("AND")) {
76 TSError("[%s] Can't have both AND and OR in mods", PLUGIN_NAME);
77 } else {
78 _mods = static_cast<CondModifiers>(_mods | COND_OR);
79 }
80 } else if (p.mod_exist("AND")) {
81 _mods = static_cast<CondModifiers>(_mods | COND_AND);
82 }
83
84 if (p.mod_exist("NOT")) {
85 _mods = static_cast<CondModifiers>(_mods | COND_NOT);
86 }
87
88 // The NOCASE / CASE modifier is a bit special, since it ripples down into the Matchers for
89 // strings and regexes.
90 if (p.mod_exist("NOCASE")) {
91 _mods = static_cast<CondModifiers>(_mods | COND_NOCASE);
92 } else if (p.mod_exist("CASE")) {
93 // Nothing to do, this is the default
94 }
95
96 if (p.mod_exist("L")) {
97 _mods = static_cast<CondModifiers>(_mods | COND_LAST);
98 }
99
100 _cond_op = parse_matcher_op(p.get_arg());
101}

Callers

nothing calls this directly

Calls 3

parse_matcher_opFunction · 0.85
mod_existMethod · 0.80
TSErrorFunction · 0.70

Tested by

no test coverage detected