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

Method init_helper

plugins/traffic_dump/transaction_data.cc:304–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304bool
305TransactionData::init_helper(bool dump_body)
306{
307 _dump_body = dump_body;
308 Dbg(dbg_ctl, "Dumping body bytes: %s", _dump_body ? "true" : "false");
309 initialize_default_sensitive_field();
310 const std::string sensitive_fields_string = get_sensitive_field_description();
311 Dbg(dbg_ctl, "Sensitive fields for which generic values will be dumped: %s", sensitive_fields_string.c_str());
312
313 if (TS_SUCCESS !=
314 TSUserArgIndexReserve(TS_USER_ARGS_TXN, traffic_dump::debug_tag, "Track transaction related data", &transaction_arg_index)) {
315 TSError("[%s] Unable to initialize plugin (disabled). Failed to reserve transaction arg.", traffic_dump::debug_tag);
316 return false;
317 }
318
319 // Register the collecting of client-request headers at the global level so
320 // we can process requests before other plugins. (Global hooks are
321 // processed before session and transaction ones.)
322 TSCont txn_cont = TSContCreate(global_transaction_handler, nullptr);
323 TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, txn_cont);
324 TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, txn_cont);
325 return true;
326}
327
328void
329TransactionData::write_client_request_node_no_content(TSMBuffer &buffer, TSMLoc &hdr_loc)

Callers

nothing calls this directly

Calls 5

TSUserArgIndexReserveFunction · 0.85
TSContCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
TSErrorFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected