| 87 | } |
| 88 | |
| 89 | void |
| 90 | Http3HeaderFramer::_generate_header_block() |
| 91 | { |
| 92 | // Prase response header and generate header block |
| 93 | int bytes_used = 0; |
| 94 | ParseResult parse_result = PARSE_RESULT_ERROR; |
| 95 | |
| 96 | if (this->_transaction->direction() == NET_VCONNECTION_OUT) { |
| 97 | this->_header.create(HTTP_TYPE_REQUEST, HTTP_3_0); |
| 98 | parse_result = this->_header.parse_req(&this->_http_parser, this->_source_vio->get_reader(), &bytes_used, false); |
| 99 | } else { |
| 100 | this->_header.create(HTTP_TYPE_RESPONSE, HTTP_3_0); |
| 101 | parse_result = this->_header.parse_resp(&this->_http_parser, this->_source_vio->get_reader(), &bytes_used, false); |
| 102 | } |
| 103 | this->_source_vio->ndone += bytes_used; |
| 104 | |
| 105 | switch (parse_result) { |
| 106 | case PARSE_RESULT_DONE: { |
| 107 | this->_hvc.convert(this->_header, 1, 3); |
| 108 | |
| 109 | this->_header_block = new_MIOBuffer(BUFFER_SIZE_INDEX_32K); |
| 110 | this->_header_block_reader = this->_header_block->alloc_reader(); |
| 111 | |
| 112 | this->_qpack->encode(this->_stream_id, this->_header, this->_header_block, this->_header_block_len); |
| 113 | break; |
| 114 | } |
| 115 | case PARSE_RESULT_CONT: |
| 116 | break; |
| 117 | default: |
| 118 | Dbg(dbg_ctl_http3_trans, "Ignore invalid headers"); |
| 119 | break; |
| 120 | } |
| 121 | } |
no test coverage detected