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

Function InjectGenerationHeader

plugins/xdebug/xdebug.cc:157–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157static void
158InjectGenerationHeader(TSHttpTxn txn, TSMBuffer buffer, TSMLoc hdr)
159{
160 TSMgmtInt value;
161 TSMLoc dst = TS_NULL_MLOC;
162
163 if (TSHttpTxnConfigIntGet(txn, TS_CONFIG_HTTP_CACHE_GENERATION, &value) == TS_SUCCESS) {
164 dst = FindOrMakeHdrField(buffer, hdr, "X-Cache-Generation", lengthof("X-Cache-Generation"));
165 if (dst != TS_NULL_MLOC) {
166 TSReleaseAssert(TSMimeHdrFieldValueInt64Set(buffer, hdr, dst, -1 /* idx */, value) == TS_SUCCESS);
167 }
168 }
169
170 if (dst != TS_NULL_MLOC) {
171 TSHandleMLocRelease(buffer, hdr, dst);
172 }
173}
174
175static void
176InjectCacheKeyHeader(TSHttpTxn txn, TSMBuffer buffer, TSMLoc hdr)

Callers 1

XInjectResponseHeadersFunction · 0.85

Calls 5

TSHttpTxnConfigIntGetFunction · 0.85
FindOrMakeHdrFieldFunction · 0.85
TSHandleMLocReleaseFunction · 0.85
lengthofFunction · 0.70

Tested by

no test coverage detected