| 132 | // |
| 133 | |
| 134 | class Http3SettingsFrame : public Http3Frame |
| 135 | { |
| 136 | public: |
| 137 | Http3SettingsFrame() : Http3Frame(Http3FrameType::SETTINGS) {} |
| 138 | Http3SettingsFrame(IOBufferReader &reader, uint32_t max_settings = 0); |
| 139 | |
| 140 | static constexpr size_t MAX_PAYLOAD_SIZE = 60; |
| 141 | static constexpr std::array<Http3SettingsId, 4> VALID_SETTINGS_IDS{ |
| 142 | Http3SettingsId::HEADER_TABLE_SIZE, |
| 143 | Http3SettingsId::MAX_FIELD_SECTION_SIZE, |
| 144 | Http3SettingsId::QPACK_BLOCKED_STREAMS, |
| 145 | Http3SettingsId::NUM_PLACEHOLDERS, |
| 146 | }; |
| 147 | |
| 148 | Ptr<IOBufferBlock> to_io_buffer_block() const override; |
| 149 | void reset(IOBufferReader &reader) override; |
| 150 | |
| 151 | Http3ErrorUPtr get_error() const; |
| 152 | |
| 153 | bool contains(Http3SettingsId id) const; |
| 154 | uint64_t get(Http3SettingsId id) const; |
| 155 | void set(Http3SettingsId id, uint64_t value); |
| 156 | |
| 157 | protected: |
| 158 | bool _parse() override; |
| 159 | |
| 160 | private: |
| 161 | uint32_t _max_settings = 0; |
| 162 | std::map<Http3SettingsId, uint64_t> _settings; |
| 163 | Http3ErrorCode _error_code; |
| 164 | const char *_error_reason = nullptr; |
| 165 | }; |
| 166 | |
| 167 | using Http3FrameDeleterFunc = void (*)(Http3Frame *p); |
| 168 | using Http3FrameUPtr = std::unique_ptr<Http3Frame, Http3FrameDeleterFunc>; |