Skip to content

Commit

Permalink
Fix InvalidMaxDynamicSize when header_table_size is set manually
Browse files Browse the repository at this point in the history
  • Loading branch information
4JX committed Aug 23, 2022
1 parent a02bc59 commit d30d291
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/codec/framed_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ impl<T> FramedRead<T> {
pub fn set_max_header_list_size(&mut self, val: usize) {
self.max_header_list_size = val;
}

/// Update the header table size setting.
#[inline]
pub fn set_header_table_size(&mut self, val: usize) {
self.hpack.queue_size_update(val);
}
}

/// Decodes a frame.
Expand Down
5 changes: 5 additions & 0 deletions src/codec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ impl<T, B> Codec<T, B> {
self.framed_write().set_header_table_size(val)
}

/// Set the decoder header table size size.
pub fn set_recv_header_table_size(&mut self, val: usize) {
self.inner.set_header_table_size(val)
}

/// Set the max header list size that can be received.
pub fn set_max_recv_header_list_size(&mut self, val: usize) {
self.inner.set_max_header_list_size(val);
Expand Down
4 changes: 4 additions & 0 deletions src/proto/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ impl Settings {
codec.set_max_recv_header_list_size(max as usize);
}

if let Some(val) = local.header_table_size() {
codec.set_recv_header_table_size(val as usize);
}

streams.apply_local_settings(local)?;
self.local = Local::Synced;
Ok(())
Expand Down

0 comments on commit d30d291

Please sign in to comment.