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

Method exec

plugins/header_rewrite/operators.cc:131–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131bool
132OperatorSetConfig::exec(const Resources &res) const
133{
134 if (TS_CONFIG_NULL != _key) {
135 switch (_type) {
136 case TS_RECORDDATATYPE_INT:
137 if (TS_SUCCESS == TSHttpTxnConfigIntSet(res.state.txnp, _key, _value.get_int_value())) {
138 Dbg(pi_dbg_ctl, "OperatorSetConfig::exec() invoked on %s=%d", _config.c_str(), _value.get_int_value());
139 } else {
140 Dbg(pi_dbg_ctl, "OperatorSetConfig::exec() invocation failed on %s=%d", _config.c_str(), _value.get_int_value());
141 }
142 break;
143 case TS_RECORDDATATYPE_FLOAT:
144 if (TS_SUCCESS == TSHttpTxnConfigFloatSet(res.state.txnp, _key, _value.get_float_value())) {
145 Dbg(pi_dbg_ctl, "OperatorSetConfig::exec() invoked on %s=%f", _config.c_str(), _value.get_float_value());
146 } else {
147 Dbg(pi_dbg_ctl, "OperatorSetConfig::exec() invocation failed on %s=%f", _config.c_str(), _value.get_float_value());
148 }
149 break;
150 case TS_RECORDDATATYPE_STRING:
151 if (TS_SUCCESS == TSHttpTxnConfigStringSet(res.state.txnp, _key, _value.get_value().c_str(), _value.size())) {
152 Dbg(pi_dbg_ctl, "OperatorSetConfig::exec() invoked on %s=%s", _config.c_str(), _value.get_value().c_str());
153 } else {
154 Dbg(pi_dbg_ctl, "OperatorSetConfig::exec() invocation failed on %s=%s", _config.c_str(), _value.get_value().c_str());
155 }
156 break;
157 default:
158 TSError("[%s] unknown data type, whut?", PLUGIN_NAME);
159 break;
160 }
161 }
162 return true;
163}
164
165// OperatorSetStatus
166void

Callers 4

regexMatchMethod · 0.45
cont_rewrite_headersFunction · 0.45
TSRemapDoRemapFunction · 0.45
matchMethod · 0.45

Calls 15

TSHttpTxnConfigIntSetFunction · 0.85
TSHttpTxnConfigFloatSetFunction · 0.85
TSHttpTxnConfigStringSetFunction · 0.85
TSHttpHdrStatusSetFunction · 0.85
TSHttpHdrReasonSetFunction · 0.85
TSHttpTxnStatusSetFunction · 0.85
TSHttpHdrUrlGetFunction · 0.85
TSUrlHostSetFunction · 0.85
TSUrlPathSetFunction · 0.85
TSUrlHttpQueryGetFunction · 0.85
TSUrlHttpQuerySetFunction · 0.85
TSUrlPortSetFunction · 0.85

Tested by

no test coverage detected