Skip to content

Commit

Permalink
HTTP/2: cancel reading buffer when ATS received GOAWAY
Browse files Browse the repository at this point in the history
  • Loading branch information
masaori335 committed Jun 17, 2019
1 parent d3639e0 commit 2047495
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions proxy/http2/Http2ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,13 @@ Http2ClientSession::state_process_frame_read(int event, VIO *vio, bool inside_fr
}

while (this->sm_reader->read_avail() >= (int64_t)HTTP2_FRAME_HEADER_LEN) {
// Cancel reading if there was an error
if (connection_state.tx_error_code.code != static_cast<uint32_t>(Http2ErrorCode::HTTP2_ERROR_NO_ERROR)) {
// Cancel reading if there was an error or connection is closed
if (connection_state.tx_error_code.code != static_cast<uint32_t>(Http2ErrorCode::HTTP2_ERROR_NO_ERROR) ||
connection_state.is_state_closed()) {
Http2SsnDebug("reading a frame has been canceled (%u)", connection_state.tx_error_code.code);
break;
}

// Return if there was an error
Http2ErrorCode err;
if (do_start_frame_read(err) < 0) {
Expand Down

0 comments on commit 2047495

Please sign in to comment.