Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a setter for header_table_size #637

Closed
4JX opened this issue Aug 21, 2022 · 3 comments · Fixed by #638
Closed

Add a setter for header_table_size #637

4JX opened this issue Aug 21, 2022 · 3 comments · Fixed by #638

Comments

@4JX
Copy link
Contributor

4JX commented Aug 21, 2022

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?

@seanmonstar
Copy link
Member

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?

@4JX
Copy link
Contributor Author

4JX commented Aug 22, 2022

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.

@seanmonstar
Copy link
Member

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

That seems fair!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants