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

Function http2_decode_header_blocks

src/proxy/http2/HTTP2.cc:439–459  ·  view source on GitHub ↗

* Decode Header Blocks to Header List. */

Source from the content-addressed store, hash-verified

437 * Decode Header Blocks to Header List.
438 */
439Http2ErrorCode
440http2_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)
462uint32_t Http2::max_concurrent_streams_in = 100;

Callers 1

decode_header_blocksMethod · 0.85

Calls 1

Tested by

no test coverage detected