This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 4f3b3c3 Use one setting for H2 consistently for header size limit on
H2 connections
4f3b3c3 is described below
commit 4f3b3c3b365737826d883784f9e33b7d287a1ee3
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Wed Jan 30 22:21:57 2019 +0900
Use one setting for H2 consistently for header size limit on H2 connections
There were two settings, "proxy.config.http.request_header_max_size" and
"proxy.config.http2.max_header_list_size", for the same purpose.
---
mgmt/RecordsConfig.cc | 2 +-
proxy/http2/HTTP2.cc | 4 +---
proxy/http2/HTTP2.h | 1 -
proxy/http2/Http2ConnectionState.cc | 4 ++--
4 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 5da12f1..8bd392f 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1319,7 +1319,7 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.http2.header_table_size", RECD_INT, "4096",
RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.http2.max_header_list_size", RECD_INT,
"4294967295", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
+ {RECT_CONFIG, "proxy.config.http2.max_header_list_size", RECD_INT, "131072",
RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.accept_no_activity_timeout", RECD_INT,
"120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index 1ce0a9d..55bd94b 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -614,7 +614,7 @@ http2_decode_header_blocks(HTTPHdr *hdr, const uint8_t
*buf_start, const uint32_
const char *value;
int len;
bool is_trailing_header = trailing_header;
- int64_t result = hpack_decode_header_block(handle, hdr, buf_start, buf_len,
Http2::max_request_header_size, maximum_table_size);
+ int64_t result = hpack_decode_header_block(handle, hdr, buf_start, buf_len,
Http2::max_header_list_size, maximum_table_size);
if (result < 0) {
if (result == HPACK_ERROR_COMPRESSION_ERROR) {
@@ -726,7 +726,6 @@ uint32_t Http2::initial_window_size = 1048576;
uint32_t Http2::max_frame_size = 16384;
uint32_t Http2::header_table_size = 4096;
uint32_t Http2::max_header_list_size = 4294967295;
-uint32_t Http2::max_request_header_size = 131072;
uint32_t Http2::accept_no_activity_timeout = 120;
uint32_t Http2::no_activity_timeout_in = 120;
uint32_t Http2::active_timeout_in = 0;
@@ -744,7 +743,6 @@ Http2::init()
REC_EstablishStaticConfigInt32U(max_frame_size,
"proxy.config.http2.max_frame_size");
REC_EstablishStaticConfigInt32U(header_table_size,
"proxy.config.http2.header_table_size");
REC_EstablishStaticConfigInt32U(max_header_list_size,
"proxy.config.http2.max_header_list_size");
- REC_EstablishStaticConfigInt32U(max_request_header_size,
"proxy.config.http.request_header_max_size");
REC_EstablishStaticConfigInt32U(accept_no_activity_timeout,
"proxy.config.http2.accept_no_activity_timeout");
REC_EstablishStaticConfigInt32U(no_activity_timeout_in,
"proxy.config.http2.no_activity_timeout_in");
REC_EstablishStaticConfigInt32U(active_timeout_in,
"proxy.config.http2.active_timeout_in");
diff --git a/proxy/http2/HTTP2.h b/proxy/http2/HTTP2.h
index dcf895b..b344743 100644
--- a/proxy/http2/HTTP2.h
+++ b/proxy/http2/HTTP2.h
@@ -372,7 +372,6 @@ public:
static uint32_t max_frame_size;
static uint32_t header_table_size;
static uint32_t max_header_list_size;
- static uint32_t max_request_header_size;
static uint32_t accept_no_activity_timeout;
static uint32_t no_activity_timeout_in;
static uint32_t active_timeout_in;
diff --git a/proxy/http2/Http2ConnectionState.cc
b/proxy/http2/Http2ConnectionState.cc
index 4df6e85..2587a89 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -237,7 +237,7 @@ rcv_headers_frame(Http2ConnectionState &cstate, const
Http2Frame &frame)
// keep track of how many bytes we get in the frame
stream->request_header_length += payload_length;
- if (stream->request_header_length > Http2::max_request_header_size) {
+ if (stream->request_header_length > Http2::max_header_list_size) {
return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM,
Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
"recv headers payload for headers greater than header
length");
}
@@ -800,7 +800,7 @@ rcv_continuation_frame(Http2ConnectionState &cstate, const
Http2Frame &frame)
// keep track of how many bytes we get in the frame
stream->request_header_length += payload_length;
- if (stream->request_header_length > Http2::max_request_header_size) {
+ if (stream->request_header_length > Http2::max_header_list_size) {
return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION,
Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
"continuation payload for headers exceeded");
}