* Decode Header Blocks to Header List. */
| 437 | * Decode Header Blocks to Header List. |
| 438 | */ |
| 439 | Http2ErrorCode |
| 440 | http2_decode_header_blocks(HTTPHdr *hdr, const uint8_t *buf_start, const uint32_t buf_len, uint32_t *len_read, HpackHandle &handle, |
| 441 | bool is_trailing_header, uint32_t maximum_table_size, bool is_outbound) |
| 442 | { |
| 443 | int64_t result = hpack_decode_header_block(handle, hdr, buf_start, buf_len, Http2::max_header_list_size, maximum_table_size); |
| 444 | |
| 445 | if (result < 0) { |
| 446 | if (result == HPACK_ERROR_COMPRESSION_ERROR) { |
| 447 | return Http2ErrorCode::HTTP2_ERROR_COMPRESSION_ERROR; |
| 448 | } else if (result == HPACK_ERROR_SIZE_EXCEEDED_ERROR) { |
| 449 | return Http2ErrorCode::HTTP2_ERROR_ENHANCE_YOUR_CALM; |
| 450 | } |
| 451 | |
| 452 | return Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR; |
| 453 | } |
| 454 | if (len_read) { |
| 455 | *len_read = result; |
| 456 | } |
| 457 | return HeaderValidator::is_h2_h3_header_valid(*hdr, is_outbound, is_trailing_header) ? Http2ErrorCode::HTTP2_ERROR_NO_ERROR : |
| 458 | Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR; |
| 459 | } |
| 460 | |
| 461 | // Initialize this subsystem with librecords configs (for now) |
| 462 | uint32_t Http2::max_concurrent_streams_in = 100; |
no test coverage detected