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

Method handle_frame

src/proxy/http3/Http3SettingsHandler.cc:41–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41Http3ErrorUPtr
42Http3SettingsHandler::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}

Callers

nothing calls this directly

Calls 9

typeMethod · 0.45
getMethod · 0.45
is_validMethod · 0.45
get_errorMethod · 0.45
containsMethod · 0.45
update_max_table_sizeMethod · 0.45
remote_qpackMethod · 0.45

Tested by

no test coverage detected