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

Function getHeader

plugins/experimental/inliner/cache-handler.h:56–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54namespace ats
55{
56bool
57getHeader(TSMBuffer buffer, TSMLoc location, const std::string &name, std::string &value)
58{
59 bool result = false;
60 const TSMLoc field = TSMimeHdrFieldFind(buffer, location, name.c_str(), name.size());
61 if (field != nullptr) {
62 int length = 0;
63 const char *const content = TSMimeHdrFieldValueStringGet(buffer, location, field, -1, &length);
64 if (content != nullptr && length > 0) {
65 value = std::string(content, length);
66 result = true;
67 }
68 TSHandleMLocRelease(buffer, location, field);
69 }
70 return result;
71}
72
73namespace inliner
74{

Callers 1

headerMethod · 0.70

Calls 6

TSMimeHdrFieldFindFunction · 0.85
stringClass · 0.85
TSHandleMLocReleaseFunction · 0.85
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected