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

Method lookup

src/proxy/http2/HPACK.cc:311–330  ·  view source on GitHub ↗

HpackIndexingTable

Source from the content-addressed store, hash-verified

309// HpackIndexingTable
310//
311HpackLookupResult
312HpackIndexingTable::lookup(const HpackHeaderField &header) const
313{
314 // static table
315 HpackLookupResult result = HpackStaticTable::lookup(header);
316
317 // if result is not EXACT match, lookup dynamic table
318 if (result.match_type == HpackMatch::EXACT) {
319 return result;
320 }
321
322 // dynamic table
323 if (XpackLookupResult dt_result = this->_dynamic_table.lookup_relative(header.name, header.value);
324 dt_result.match_type == XpackLookupResult::MatchType::EXACT) {
325 return {static_cast<uint32_t>(TS_HPACK_STATIC_TABLE_ENTRY_NUM + dt_result.index), HpackIndex::DYNAMIC,
326 static_cast<HpackMatch>(dt_result.match_type)};
327 }
328
329 return result;
330}
331
332int
333HpackIndexingTable::get_header_field(uint32_t index, MIMEFieldWrapper &field) const

Callers 3

chashLookupMethod · 0.45

Calls 2

lookupFunction · 0.85
lookup_relativeMethod · 0.80

Tested by

no test coverage detected