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

Function headerExist

plugins/prefetch/headers.cc:64–73  ·  view source on GitHub ↗

* @brief Checks if the header exists. * * @param bufp request's buffer * @param hdrLoc request's header location * @return true - exists, false - does not exist */

Source from the content-addressed store, hash-verified

62 * @return true - exists, false - does not exist
63 */
64bool
65headerExist(TSMBuffer bufp, TSMLoc hdrLoc, const char *header, int headerlen)
66{
67 TSMLoc fieldLoc = TSMimeHdrFieldFind(bufp, hdrLoc, header, headerlen);
68 if (TS_NULL_MLOC != fieldLoc) {
69 TSHandleMLocRelease(bufp, hdrLoc, fieldLoc);
70 return true;
71 }
72 return false;
73}
74
75/**
76 * @brief Get the header value

Callers 1

TSRemapDoRemapFunction · 0.70

Calls 2

TSMimeHdrFieldFindFunction · 0.85
TSHandleMLocReleaseFunction · 0.85

Tested by

no test coverage detected