Skip to content

Fix rounding error in hpack resizing#559

Open
DmitriyMusatkin wants to merge 3 commits into
mainfrom
hpack
Open

Fix rounding error in hpack resizing#559
DmitriyMusatkin wants to merge 3 commits into
mainfrom
hpack

Conversation

@DmitriyMusatkin
Copy link
Copy Markdown
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.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.79%. Comparing base (2a22c94) to head (3a75462).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #559      +/-   ##
==========================================
+ Coverage   79.76%   79.79%   +0.03%     
==========================================
  Files          28       28              
  Lines       12085    12085              
==========================================
+ Hits         9639     9643       +4     
+ Misses       2446     2442       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread source/hpack.c
context->dynamic_table.buffer_capacity
? (size_t)(context->dynamic_table.buffer_capacity * s_hpack_dynamic_table_buffer_growth_rate)
/* increase buffer by 1.5 rounded up. */
? (size_t)(context->dynamic_table.buffer_capacity + ((context->dynamic_table.buffer_capacity + 1) / 2))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot get a 0 buffer_capacity?

Will it be more clear if we do a min(context->dynamic_table.buffer_capacity / 2, 1)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from my reading of code, s_dynamic_table_resize_buffer supports new size of 0, which will result in buffer_capacity being 0.
wouldn't that min always result in 1?

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.

3 participants