Skip to content

Conversation

@TingDaoK
Copy link
Contributor

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:

  • Track which Setting frame is ACKed by the peer. When implementing the Client API of sending Settings.
  • header_table_size will be used for dynamic table resize rules. But ignore it now?
  • max_header_list_size is ignored...

@TingDaoK TingDaoK requested review from a team and graebm March 26, 2020 23:49
Comment on lines 546 to 551
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;
}
Copy link
Contributor

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

Copy link
Contributor Author

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

aws_error_name(aws_last_error()));
goto error;
}
if (setting.id == AWS_H2_SETTINGS_HEADER_TABLE_SIZE) {
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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)
    ...

@TingDaoK TingDaoK merged commit d0c3a07 into master Mar 30, 2020
@TingDaoK TingDaoK deleted the h2_setting_frame branch March 30, 2020 16:03
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 this pull request may close these issues.

2 participants