Skip to content

Commit 2c5a3cf

Browse files
committed
Flush API change.
Signed-off-by: Kevin Baichoo <envoy@kevinbaichoo.com>
1 parent 44ac78a commit 2c5a3cf

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

api/envoy/config/core/v3/protocol.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,11 @@ message Http2ProtocolOptions {
663663
// Configure the maximum amount of metadata than can be handled per stream. Defaults to 1 MB.
664664
google.protobuf.UInt64Value max_metadata_size = 17;
665665

666-
// Disables encoding the headers using huffman encoding.
666+
// Controls whether to encode headers using huffman encoding.
667667
// This can be useful in cases where the cpu spent encoding the headers isn't
668668
// worth the network bandwidth saved e.g. for localhost.
669-
bool disable_huffman_encoding = 18;
669+
// If unset, uses the data plane's default value.
670+
google.protobuf.BoolValue enable_huffman_encoding = 18;
670671
}
671672

672673
// [#not-implemented-hide:]

source/common/http/http2/codec_impl.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ ConnectionImpl::Http2Options::Http2Options(
20822082
og_options_.max_header_field_size = max_headers_kb * 1024;
20832083
og_options_.allow_extended_connect = http2_options.allow_connect();
20842084
og_options_.allow_different_host_and_authority = true;
2085-
if (http2_options.disable_huffman_encoding()) {
2085+
if (!PROTOBUF_GET_WRAPPED_OR_DEFAULT(http2_options, enable_huffman_encoding, true)) {
20862086
if (http2_options.has_hpack_table_size() && http2_options.hpack_table_size().value() == 0) {
20872087
og_options_.compression_option = http2::adapter::OgHttp2Session::Options::DISABLE_COMPRESSION;
20882088
} else {
@@ -2119,7 +2119,7 @@ ConnectionImpl::Http2Options::Http2Options(
21192119
http2_options.hpack_table_size().value());
21202120
}
21212121

2122-
if (http2_options.disable_huffman_encoding()) {
2122+
if (!PROTOBUF_GET_WRAPPED_OR_DEFAULT(http2_options, enable_huffman_encoding, true)) {
21232123
nghttp2_option_set_disable_huffman_encoding(options_, 1);
21242124
}
21252125

test/common/http/http2/codec_impl_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ TEST_P(Http2CodecImplTest, TestCanDisableHuffmanEncoding) {
31883188
request_headers.addCopy("x-well-compressable-header", std::string(1000, 'a'));
31893189

31903190
// Create a connection with huffman disabled.
3191-
client_http2_options_.set_disable_huffman_encoding(true);
3191+
client_http2_options_.mutable_enable_huffman_encoding()->set_value(false);
31923192
initialize();
31933193

31943194
std::string buffer_without_huffman;
@@ -3206,7 +3206,7 @@ TEST_P(Http2CodecImplTest, TestCanDisableHuffmanEncoding) {
32063206
ASSERT_EQ(server_wrapper_->buffer_.length(), 0);
32073207

32083208
// Create a connection with huffman enabled.
3209-
client_http2_options_.set_disable_huffman_encoding(false);
3209+
client_http2_options_.mutable_enable_huffman_encoding()->set_value(true);
32103210
NiceMock<Network::MockConnection> client_connection2;
32113211
MockConnectionCallbacks client_callbacks2;
32123212
client_ = std::make_unique<TestClientConnectionImpl>(

0 commit comments

Comments
 (0)