You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2019/06/17 23:42:40 UTC

[trafficserver] branch master updated: HTTP/2: cancel reading buffer when ATS received GOAWAY

This is an automated email from the ASF dual-hosted git repository.

masaori 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 2047495  HTTP/2: cancel reading buffer when ATS received GOAWAY
2047495 is described below

commit 204749518b8265ecf466187ccdf6b6f881d9724f
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Jun 14 09:39:48 2019 +0900

    HTTP/2: cancel reading buffer when ATS received GOAWAY
---
 proxy/http2/Http2ClientSession.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index 0bb8624..e033ef5 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -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) {