-
Notifications
You must be signed in to change notification settings - Fork 49
H2 setting frame #206
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
H2 setting frame #206
Conversation
source/h2_connection.c
Outdated
| static void s_aws_h2_connection_change_peer_settings( | ||
| struct aws_h2_connection *connection, | ||
| struct aws_h2_frame_setting setting) { | ||
| uint32_t *settings_peer = connection->thread_data.settings_peer; | ||
| settings_peer[setting.id] = setting.value; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial: this doesn't need to be a function, it's 1 line long and called from 1 place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, I just think it may have more functions, like informing others? But since the encoder is the only one who will be informed, it is not needed to be a function
source/h2_connection.c
Outdated
| aws_error_name(aws_last_error())); | ||
| goto error; | ||
| } | ||
| if (setting.id == AWS_H2_SETTINGS_HEADER_TABLE_SIZE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial/efficiency: maybe just continue if new value matches existing value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the switch statement right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like, before the switch we can just do:
if (connection->thread_data.settings_peer[setting.id] == setting.value) {
/* No change, don't do any work */
continue;
}
switch (setting.id)
...
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Finished the way when a Setting frame received. And decoder&encoder depending on the real setting values now.
TODO: