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

Function cont_remap

tests/tools/plugins/user_args.cc:75–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static int
76cont_remap(TSCont contp, TSEvent /* event ATS_UNUSED */, void *edata)
77{
78 TSMBuffer bufp;
79 TSMLoc hdrs;
80 ArgIndexes *ix = static_cast<ArgIndexes *>(TSContDataGet(contp));
81 TSHttpTxn txnp = static_cast<TSHttpTxn>(edata);
82 TSHttpSsn ssnp = TSHttpTxnSsnGet(txnp);
83 TSVConn vconnp = TSHttpSsnClientVConnGet(ssnp);
84
85 if (TS_SUCCESS == TSHttpTxnClientRespGet(txnp, &bufp, &hdrs)) {
86 set_header(bufp, hdrs, "X-Arg-GLB", static_cast<const char *>(TSUserArgGet(nullptr, ix->GLB)));
87 set_header(bufp, hdrs, "X-Arg-TXN", static_cast<const char *>(TSUserArgGet(txnp, ix->TXN)));
88 set_header(bufp, hdrs, "X-Arg-SSN", static_cast<const char *>(TSUserArgGet(ssnp, ix->SSN)));
89 set_header(bufp, hdrs, "X-Arg-VCONN", static_cast<const char *>(TSUserArgGet(vconnp, ix->VCONN)));
90 }
91
92 TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
93
94 return 0;
95}
96
97// Called by ATS as our initialization point
98void

Callers

nothing calls this directly

Calls 7

TSContDataGetFunction · 0.85
TSHttpTxnSsnGetFunction · 0.85
TSHttpSsnClientVConnGetFunction · 0.85
TSHttpTxnClientRespGetFunction · 0.85
TSUserArgGetFunction · 0.85
TSHttpTxnReenableFunction · 0.85
set_headerFunction · 0.70

Tested by

no test coverage detected