You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ez...@apache.org on 2019/05/16 17:30:26 UTC

[trafficserver] branch 7.1.x updated (69d1f7e -> 0b7685a)

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

eze pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 69d1f7e  Revert TS-374 to avoid deadlocks
     new 43429b7  Add ProxyError structure
     new 0b7685a  Don't read frames after sending GOAWAY with an error code

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 proxy/ProxyClientSession.h          | 15 +++++++++++++++
 proxy/http2/Http2ClientSession.cc   |  5 +++++
 proxy/http2/Http2ConnectionState.cc |  3 +++
 proxy/http2/Http2ConnectionState.h  |  2 ++
 4 files changed, 25 insertions(+)


[trafficserver] 01/02: Add ProxyError structure

Posted by ez...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eze pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 43429b74b4233fef6b3270bf5a500ae854cdc656
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue May 14 09:14:09 2019 +0900

    Add ProxyError structure
    
    The structure was originally added as a part of #3545, and this commit brings
    only the data structure and minimul changes needed from the original commit.
---
 proxy/ProxyClientSession.h          | 15 +++++++++++++++
 proxy/http2/Http2ConnectionState.cc |  3 +++
 proxy/http2/Http2ConnectionState.h  |  2 ++
 3 files changed, 20 insertions(+)

diff --git a/proxy/ProxyClientSession.h b/proxy/ProxyClientSession.h
index 85f62a0..22190e6 100644
--- a/proxy/ProxyClientSession.h
+++ b/proxy/ProxyClientSession.h
@@ -37,6 +37,21 @@
 class ProxyClientTransaction;
 struct AclRecord;
 
+enum class ProxyErrorClass {
+  NONE,
+  SSN,
+  TXN,
+};
+
+struct ProxyError {
+  ProxyError() {}
+  ProxyError(ProxyErrorClass cl, uint32_t co) : cls(cl), code(co) {}
+  size_t str(char *buf, size_t buf_len);
+
+  ProxyErrorClass cls = ProxyErrorClass::NONE;
+  uint32_t code       = 0;
+};
+
 class ProxyClientSession : public VConnection
 {
 public:
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index a62d386..7f81cf4 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -636,6 +636,7 @@ rcv_goaway_frame(Http2ConnectionState &cstate, const Http2Frame &frame)
   Http2StreamDebug(cstate.ua_session, stream_id, "GOAWAY: last stream id=%d, error code=%d", goaway.last_streamid,
                    static_cast<int>(goaway.error_code));
 
+  cstate.rx_error_code = {ProxyErrorClass::SSN, static_cast<uint32_t>(goaway.error_code)};
   cstate.handleEvent(HTTP2_SESSION_EVENT_FINI, nullptr);
   // eventProcessor.schedule_imm(&cs, ET_NET, VC_EVENT_ERROR);
 
@@ -1724,6 +1725,8 @@ Http2ConnectionState::send_goaway_frame(Http2StreamId id, Http2ErrorCode ec)
   http2_write_goaway(goaway, frame.write());
   frame.finalize(HTTP2_GOAWAY_LEN);
 
+  this->tx_error_code = {ProxyErrorClass::SSN, static_cast<uint32_t>(ec)};
+
   // xmit event
   SCOPED_MUTEX_LOCK(lock, this->ua_session->mutex, this_ethread());
   this->ua_session->handleEvent(HTTP2_SESSION_EVENT_XMIT, &frame);
diff --git a/proxy/http2/Http2ConnectionState.h b/proxy/http2/Http2ConnectionState.h
index f3b4cc3..e773f32 100644
--- a/proxy/http2/Http2ConnectionState.h
+++ b/proxy/http2/Http2ConnectionState.h
@@ -132,6 +132,8 @@ public:
     SET_HANDLER(&Http2ConnectionState::main_event_handler);
   }
 
+  ProxyError rx_error_code;
+  ProxyError tx_error_code;
   Http2ClientSession *ua_session;
   HpackHandle *local_hpack_handle;
   HpackHandle *remote_hpack_handle;


[trafficserver] 02/02: Don't read frames after sending GOAWAY with an error code

Posted by ez...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eze pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 0b7685afbe271c14a99f7cfeefb3f181e50fc89f
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Thu Apr 18 22:27:49 2019 +0900

    Don't read frames after sending GOAWAY with an error code
    
    (cherry picked from commit 00237a141cdb6d9f2268080f03cb5f58ee32c7ec)
---
 proxy/http2/Http2ClientSession.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index f61cf70..8dc30c3 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -499,6 +499,11 @@ 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)) {
+      DebugHttp2Ssn("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) {