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

Method timeForKey

plugins/slice/HttpHeader.cc:235–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235bool
236HttpHeader::timeForKey(char const *const keystr, int const keylen, time_t *const timeval) const
237{
238 TSAssert(nullptr != timeval);
239
240 if (!isValid()) {
241 *timeval = 0;
242 return false;
243 }
244
245 bool status = false;
246
247 TSMLoc const locfield = TSMimeHdrFieldFind(m_buffer, m_lochdr, keystr, keylen);
248
249 if (nullptr != locfield) {
250 *timeval = TSMimeHdrFieldValueDateGet(m_buffer, m_lochdr, locfield);
251 TSHandleMLocRelease(m_buffer, m_lochdr, locfield);
252 } else {
253 *timeval = 0;
254 }
255
256 return status;
257}
258
259bool
260HttpHeader::setKeyTime(char const *const keystr, int const keylen, time_t const timeval)

Callers 2

logSliceErrorFunction · 0.80
handleNextServerHeaderFunction · 0.80

Calls 3

TSMimeHdrFieldFindFunction · 0.85
TSHandleMLocReleaseFunction · 0.85

Tested by

no test coverage detected