| 25 | #include "proxy/http3/Http3Config.h" |
| 26 | |
| 27 | Http3FrameUPtr |
| 28 | Http3SettingsFramer::generate_frame() |
| 29 | { |
| 30 | if (this->_is_sent) { |
| 31 | return Http3FrameFactory::create_null_frame(); |
| 32 | } |
| 33 | |
| 34 | this->_is_sent = true; |
| 35 | |
| 36 | ts::Http3Config::scoped_config params; |
| 37 | |
| 38 | Http3SettingsFrame *frame = http3SettingsFrameAllocator.alloc(); |
| 39 | new (frame) Http3SettingsFrame(); |
| 40 | |
| 41 | if (params->header_table_size() != HTTP3_DEFAULT_HEADER_TABLE_SIZE) { |
| 42 | frame->set(Http3SettingsId::HEADER_TABLE_SIZE, params->header_table_size()); |
| 43 | } |
| 44 | |
| 45 | if (params->max_field_section_size() != HTTP3_DEFAULT_MAX_FIELD_SECTION_SIZE) { |
| 46 | frame->set(Http3SettingsId::MAX_FIELD_SECTION_SIZE, params->max_field_section_size()); |
| 47 | } |
| 48 | |
| 49 | if (params->qpack_blocked_streams() != HTTP3_DEFAULT_QPACK_BLOCKED_STREAMS) { |
| 50 | frame->set(Http3SettingsId::QPACK_BLOCKED_STREAMS, params->qpack_blocked_streams()); |
| 51 | } |
| 52 | |
| 53 | // Server side only |
| 54 | if (this->_context == NET_VCONNECTION_IN) { |
| 55 | if (params->num_placeholders() != HTTP3_DEFAULT_NUM_PLACEHOLDERS) { |
| 56 | frame->set(Http3SettingsId::NUM_PLACEHOLDERS, params->num_placeholders()); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | return Http3SettingsFrameUPtr(frame, &Http3FrameDeleter::delete_settings_frame); |
| 61 | } |
| 62 | |
| 63 | bool |
| 64 | Http3SettingsFramer::is_done() const |
nothing calls this directly
no test coverage detected