Skip to content

Commit 9701a82

Browse files
jasnelladuh95
authored andcommitted
quic: handle h3 max header size option
Signed-off-by: James M Snell <[email protected]> PR-URL: #63483 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 71788a2 commit 9701a82

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/quic/application.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ Maybe<Session::Application_Options> Session::Application_Options::From(
115115

116116
#undef SET
117117

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+
118125
return Just<Application_Options>(options);
119126
}
120127

src/quic/session.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
7272
uint64_t max_header_length = DEFAULT_MAX_HEADER_LENGTH;
7373

7474
// 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;
7680
uint64_t qpack_max_dtable_capacity = 4096;
7781
uint64_t qpack_encoder_max_dtable_capacity = 4096;
7882
uint64_t qpack_blocked_streams = 100;

0 commit comments

Comments
 (0)