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

fix h2 protocol abnormal case when SETTINGS_HEADER_TABLE_SIZE set to zero #2373

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/brpc/policy/http2_rpc_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,10 @@ H2UnsentRequest::AppendAndDestroySelf(butil::IOBuf* out, Socket* socket) {
HPackOptions options;
options.encode_name = FLAGS_h2_hpack_encode_name;
options.encode_value = FLAGS_h2_hpack_encode_value;
if (ctx->remote_settings().header_table_size == 0) {
options.index_policy = HPACK_NEVER_INDEX_HEADER;
}

for (size_t i = 0; i < _size; ++i) {
hpacker.Encode(&appender, _list[i], options);
}
Expand Down Expand Up @@ -1710,6 +1714,9 @@ H2UnsentResponse::AppendAndDestroySelf(butil::IOBuf* out, Socket* socket) {
HPackOptions options;
options.encode_name = FLAGS_h2_hpack_encode_name;
options.encode_value = FLAGS_h2_hpack_encode_value;
if (ctx->remote_settings().header_table_size == 0) {
options.index_policy = HPACK_NEVER_INDEX_HEADER;
}

for (size_t i = 0; i < _size; ++i) {
hpacker.Encode(&appender, _list[i], options);
Expand Down
Loading