You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2015/07/14 00:47:29 UTC
trafficserver git commit: TS-3752: Problem with larger headers and
HTTP/2
Repository: trafficserver
Updated Branches:
refs/heads/master 691a49abc -> 6c4c7226e
TS-3752: Problem with larger headers and HTTP/2
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6c4c7226
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6c4c7226
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6c4c7226
Branch: refs/heads/master
Commit: 6c4c7226ea4d25c084d1d6b97ae6fec262b9f1f3
Parents: 691a49a
Author: Bryan Call <bc...@apache.org>
Authored: Mon Jul 13 15:46:52 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Mon Jul 13 15:46:52 2015 -0700
----------------------------------------------------------------------
proxy/http2/Http2ConnectionState.cc | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6c4c7226/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 96eaa3a..c085f67 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -224,7 +224,7 @@ rcv_headers_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, const Ht
// 4.3. A receiver MUST terminate the connection with a
// connection error of type COMPRESSION_ERROR if it does
// not decompress a header block.
- if (decoded_bytes == 0 || decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
+ if (decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
return HTTP2_ERROR_COMPRESSION_ERROR;
}
@@ -546,7 +546,7 @@ rcv_continuation_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, con
// A receiver MUST terminate the connection with a
// connection error of type COMPRESSION_ERROR if it does
// not decompress a header block.
- if (decoded_bytes == 0 || decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
+ if (decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
return HTTP2_ERROR_COMPRESSION_ERROR;
}
@@ -770,6 +770,8 @@ Http2ConnectionState::cleanup_streams()
void
Http2ConnectionState::set_continued_headers(const char *buf, uint32_t len, Http2StreamId id)
{
+ DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send CONTINUATION frame.", this->ua_session->connection_id());
+
if (buf && len > 0) {
if (!continued_buffer.iov_base) {
continued_buffer.iov_base = static_cast<uint8_t *>(ats_malloc(len));
@@ -815,11 +817,11 @@ Http2ConnectionState::update_initial_rwnd(Http2WindowSize new_size)
void
Http2ConnectionState::send_data_frame(FetchSM *fetch_sm)
{
+ DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send DATA frame", this->ua_session->connection_id());
+
size_t buf_len = BUFFER_SIZE_FOR_INDEX(buffer_size_index[HTTP2_FRAME_TYPE_DATA]) - HTTP2_FRAME_HEADER_LEN;
uint8_t payload_buffer[buf_len];
- DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send DATA frame.", this->ua_session->connection_id());
-
Http2Stream *stream = static_cast<Http2Stream *>(fetch_sm->ext_get_user_data());
for (;;) {
@@ -878,6 +880,8 @@ Http2ConnectionState::send_data_frame(FetchSM *fetch_sm)
void
Http2ConnectionState::send_headers_frame(FetchSM *fetch_sm)
{
+ DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send HEADERS frame.", this->ua_session->connection_id());
+
const size_t buf_len = BUFFER_SIZE_FOR_INDEX(buffer_size_index[HTTP2_FRAME_TYPE_HEADERS]) - HTTP2_FRAME_HEADER_LEN;
uint8_t payload_buffer[buf_len];
size_t payload_length = 0;
@@ -925,6 +929,8 @@ Http2ConnectionState::send_headers_frame(FetchSM *fetch_sm)
void
Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec)
{
+ DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send RST_STREAM frame.", this->ua_session->connection_id());
+
Http2Frame rst_stream(HTTP2_FRAME_TYPE_RST_STREAM, id, 0);
rst_stream.alloc(buffer_size_index[HTTP2_FRAME_TYPE_RST_STREAM]);
@@ -939,6 +945,8 @@ Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec)
void
Http2ConnectionState::send_ping_frame(Http2StreamId id, uint8_t flag, const uint8_t *opaque_data)
{
+ DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send PING frame.", this->ua_session->connection_id());
+
Http2Frame ping(HTTP2_FRAME_TYPE_PING, id, flag);
ping.alloc(buffer_size_index[HTTP2_FRAME_TYPE_PING]);
@@ -953,6 +961,8 @@ Http2ConnectionState::send_ping_frame(Http2StreamId id, uint8_t flag, const uint
void
Http2ConnectionState::send_goaway_frame(Http2StreamId id, Http2ErrorCode ec)
{
+ DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send GOAWAY frame.", this->ua_session->connection_id());
+
Http2Frame frame(HTTP2_FRAME_TYPE_GOAWAY, 0, 0);
Http2Goaway goaway;
@@ -975,6 +985,8 @@ Http2ConnectionState::send_goaway_frame(Http2StreamId id, Http2ErrorCode ec)
void
Http2ConnectionState::send_window_update_frame(Http2StreamId id, uint32_t size)
{
+ DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send WINDOW_UPDATE frame.", this->ua_session->connection_id());
+
// Create WINDOW_UPDATE frame
Http2Frame window_update(HTTP2_FRAME_TYPE_WINDOW_UPDATE, id, 0x0);
window_update.alloc(buffer_size_index[HTTP2_FRAME_TYPE_WINDOW_UPDATE]);