[RFC 7541] 6.3. Dynamic Table Size Update
| 664 | // [RFC 7541] 6.3. Dynamic Table Size Update |
| 665 | // |
| 666 | int64_t |
| 667 | update_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 | |
| 690 | int64_t |
| 691 | hpack_decode_header_block(HpackIndexingTable &indexing_table, HTTPHdr *hdr, const uint8_t *in_buf, const size_t in_buf_len, |
no test coverage detected