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

Function update_dynamic_table_size

src/proxy/http2/HPACK.cc:666–688  ·  view source on GitHub ↗

[RFC 7541] 6.3. Dynamic Table Size Update

Source from the content-addressed store, hash-verified

664// [RFC 7541] 6.3. Dynamic Table Size Update
665//
666int64_t
667update_dynamic_table_size(const uint8_t *buf_start, const uint8_t *buf_end, HpackIndexingTable &indexing_table,
668 uint32_t maximum_table_size)
669{
670 if (buf_start == buf_end) {
671 return HPACK_ERROR_COMPRESSION_ERROR;
672 }
673
674 // Update header table size if its required.
675 uint64_t size = 0;
676 int64_t len = xpack_decode_integer(size, buf_start, buf_end, 5);
677 if (len == XPACK_ERROR_COMPRESSION_ERROR) {
678 return HPACK_ERROR_COMPRESSION_ERROR;
679 }
680
681 if (size > maximum_table_size) {
682 return HPACK_ERROR_COMPRESSION_ERROR;
683 }
684
685 indexing_table.update_maximum_size(size);
686
687 return len;
688}
689
690int64_t
691hpack_decode_header_block(HpackIndexingTable &indexing_table, HTTPHdr *hdr, const uint8_t *in_buf, const size_t in_buf_len,

Callers 1

Calls 2

xpack_decode_integerFunction · 0.85
update_maximum_sizeMethod · 0.45

Tested by

no test coverage detected