| 39 | } |
| 40 | |
| 41 | Http3ErrorUPtr |
| 42 | Http3SettingsHandler::handle_frame(std::shared_ptr<const Http3Frame> frame, Http3StreamType /* s_type */) |
| 43 | { |
| 44 | ink_assert(frame->type() == Http3FrameType::SETTINGS); |
| 45 | |
| 46 | const Http3SettingsFrame *settings_frame = dynamic_cast<const Http3SettingsFrame *>(frame.get()); |
| 47 | |
| 48 | if (!settings_frame) { |
| 49 | // make error |
| 50 | return Http3ErrorUPtr(nullptr); |
| 51 | } |
| 52 | |
| 53 | if (!settings_frame->is_valid()) { |
| 54 | return settings_frame->get_error(); |
| 55 | } |
| 56 | |
| 57 | // TODO: Add length check: the maximum number of values are 2^62 - 1, but some fields have shorter maximum than it. |
| 58 | if (settings_frame->contains(Http3SettingsId::HEADER_TABLE_SIZE)) { |
| 59 | uint64_t header_table_size = settings_frame->get(Http3SettingsId::HEADER_TABLE_SIZE); |
| 60 | this->_session->remote_qpack()->update_max_table_size(header_table_size); |
| 61 | |
| 62 | Dbg(dbg_ctl_http3, "SETTINGS_HEADER_TABLE_SIZE: %" PRId64, header_table_size); |
| 63 | } |
| 64 | |
| 65 | if (settings_frame->contains(Http3SettingsId::MAX_FIELD_SECTION_SIZE)) { |
| 66 | uint64_t max_field_section_size = settings_frame->get(Http3SettingsId::MAX_FIELD_SECTION_SIZE); |
| 67 | this->_session->remote_qpack()->update_max_field_section_size(max_field_section_size); |
| 68 | |
| 69 | Dbg(dbg_ctl_http3, "SETTINGS_MAX_FIELD_SECTION_SIZE: %" PRId64, max_field_section_size); |
| 70 | } |
| 71 | |
| 72 | if (settings_frame->contains(Http3SettingsId::QPACK_BLOCKED_STREAMS)) { |
| 73 | uint64_t qpack_blocked_streams = settings_frame->get(Http3SettingsId::QPACK_BLOCKED_STREAMS); |
| 74 | this->_session->remote_qpack()->update_max_blocking_streams(qpack_blocked_streams); |
| 75 | |
| 76 | Dbg(dbg_ctl_http3, "SETTINGS_QPACK_BLOCKED_STREAMS: %" PRId64, qpack_blocked_streams); |
| 77 | } |
| 78 | |
| 79 | if (settings_frame->contains(Http3SettingsId::NUM_PLACEHOLDERS)) { |
| 80 | uint64_t num_placeholders = settings_frame->get(Http3SettingsId::NUM_PLACEHOLDERS); |
| 81 | // TODO: update settings for priority tree |
| 82 | |
| 83 | Dbg(dbg_ctl_http3, "SETTINGS_NUM_PLACEHOLDERS: %" PRId64, num_placeholders); |
| 84 | } |
| 85 | |
| 86 | return Http3ErrorUPtr(nullptr); |
| 87 | } |
nothing calls this directly
no test coverage detected