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

Function http_insert_forwarded_cb

src/proxy/http/HttpConfig.cc:242–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242static int
243http_insert_forwarded_cb(const char *name, RecDataT dtype, RecData data, void *cookie)
244{
245 bool valid_p = false;
246 HttpConfigParams *c = static_cast<HttpConfigParams *>(cookie);
247
248 if (0 == strcasecmp("proxy.config.http.insert_forwarded", name)) {
249 if (RECD_STRING == dtype) {
250 swoc::LocalBufferWriter<1024> error;
251 HttpForwarded::OptionBitSet bs = HttpForwarded::optStrToBitset(std::string_view(data.rec_string), error);
252 if (!error.size()) {
253 c->oride.insert_forwarded = bs;
254 valid_p = true;
255 } else {
256 Error("HTTP %.*s", static_cast<int>(error.size()), error.data());
257 }
258 }
259 }
260
261 // Signal an update if valid value arrived.
262 if (valid_p) {
263 http_config_cb(name, dtype, data, cookie);
264 }
265
266 return REC_ERR_OKAY;
267}
268
269void
270register_stat_callbacks()

Callers

nothing calls this directly

Calls 6

strcasecmpFunction · 0.85
optStrToBitsetFunction · 0.85
http_config_cbFunction · 0.85
ErrorClass · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected