GeezerVison is showing github.com — quic: handle h3 max header size option · nodejs/node@dbe0b37
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/quic/application.cc +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -115,6 +115,13 @@ Maybe<Session::Application_Options> Session::Application_Options::From( |
115 | 115 |
|
116 | 116 | #undef SET |
117 | 117 |
|
| 118 | + // Ensure the advertised max_field_section_size in SETTINGS is at least |
| 119 | + // as large as max_header_length. Otherwise the peer would be told to |
| 120 | + // restrict headers to a smaller size than what CanAddHeader accepts. |
| 121 | + if (options.max_field_section_size < options.max_header_length) { |
| 122 | + options.max_field_section_size = options.max_header_length; |
| 123 | + } |
| 124 | + |
118 | 125 | return Just<Application_Options>(options); |
119 | 126 | } |
120 | 127 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/quic/session.h +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -72,7 +72,11 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source { |
72 | 72 | uint64_t max_header_length = DEFAULT_MAX_HEADER_LENGTH; |
73 | 73 |
|
74 | 74 | // HTTP/3 specific options. |
75 | | - uint64_t max_field_section_size = 0; |
| 75 | + // The maximum header section size advertised to the peer in SETTINGS. |
| 76 | + // Defaults to match max_header_length so the SETTINGS frame accurately |
| 77 | + // reflects the enforcement limit. A value of 0 would incorrectly tell |
| 78 | + // the peer not to send any headers at all. |
| 79 | + uint64_t max_field_section_size = DEFAULT_MAX_HEADER_LENGTH; |
76 | 80 | uint64_t qpack_max_dtable_capacity = 4096; |
77 | 81 | uint64_t qpack_encoder_max_dtable_capacity = 4096; |
78 | 82 | uint64_t qpack_blocked_streams = 100; |
|