hyperium / h2

HTTP 2.0 client & server implementation for Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a setter for `header_table_size`

4JX opened this issue · comments

commented

I'd like to make a PR to uncomment the setter for header_table_size, found here:

h2/src/frame/settings.rs

Lines 124 to 128 in 87969c1

/*
pub fn set_header_table_size(&mut self, size: Option<u32>) {
self.header_table_size = size;
}
*/

When playing around with the setter I found out that connections would sometimes fail the following check, Since the decoder's size is never updated from the default DEFAULT_SETTINGS_HEADER_TABLE_SIZE.

h2/src/hpack/decoder.rs

Lines 256 to 258 in 88b0789

if new_size > self.last_max_update {
return Err(DecoderError::InvalidMaxDynamicSize);
}

Would this be the place to fix that?

What would adding the setter do? The frames aren't part of any public API, so a user couldn't do anything with function. Is there something extra that h2 should be doing? What's the underlying problem you're trying to solve?

commented

The frames aren't part of any public API, so a user couldn't do anything with function.

I'd want to expose that option through h2::client::Builder, the same way max_concurrent_streams and others are.

What's the underlying problem you're trying to solve?

I'm doing some research into HTTP2 based fingerprinting. Its mostly about the flexibility of being able to set that value at will. (And also other things, which would not really matter for the average user)

I understand that adding something like this may not be in the scope of the project.

I'd want to expose that option through h2::client::Builder, the same way max_concurrent_streams and others are.

That seems fair!