You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2020/08/04 01:46:02 UTC

[trafficserver] branch 9.0.x updated: Fix a crash on active timeout on QUIC connections (#7059)

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 35f9db9  Fix a crash on active timeout on QUIC connections (#7059)
35f9db9 is described below

commit 35f9db902c69a11e28bbd71168ee904315033491
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Fri Jul 31 09:19:59 2020 +0900

    Fix a crash on active timeout on QUIC connections (#7059)
    
    This closes #7042
    
    (cherry picked from commit 3087f1642d10d19ca68c0e4e2c5e671f9a826561)
---
 iocore/net/P_QUICNetVConnection.h |  1 +
 iocore/net/QUICNetVConnection.cc  | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h
index a7aee81..a3f24a4 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -349,6 +349,7 @@ private:
 
   void _handle_periodic_ack_event();
   void _handle_idle_timeout();
+  void _handle_active_timeout();
 
   QUICConnectionErrorUPtr _handle_frame(const QUICNewConnectionIdFrame &frame);
 
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 8338753..3c129d9 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -838,6 +838,10 @@ QUICNetVConnection::state_handshake(int event, Event *data)
     // Start Immediate Close because of Idle Timeout
     this->_handle_idle_timeout();
     break;
+  case VC_EVENT_ACTIVE_TIMEOUT:
+    // Start Immediate Close
+    this->_handle_active_timeout();
+    break;
   default:
     QUICConDebug("Unexpected event: %s (%d)", QUICDebugNames::quic_event(event), event);
   }
@@ -874,6 +878,10 @@ QUICNetVConnection::state_connection_established(int event, Event *data)
     // Start Immediate Close because of Idle Timeout
     this->_handle_idle_timeout();
     break;
+  case VC_EVENT_ACTIVE_TIMEOUT:
+    // Start Immediate Close
+    this->_handle_active_timeout();
+    break;
   default:
     QUICConDebug("Unexpected event: %s (%d)", QUICDebugNames::quic_event(event), event);
   }
@@ -906,6 +914,9 @@ QUICNetVConnection::state_connection_closing(int event, Event *data)
     break;
   case QUIC_EVENT_STATELESS_RESET:
     break;
+  case VC_EVENT_ACTIVE_TIMEOUT:
+    // Do nothing because closing is in progress
+    break;
   case QUIC_EVENT_ACK_PERIODIC:
   default:
     QUICConDebug("Unexpected event: %s (%d)", QUICDebugNames::quic_event(event), event);
@@ -936,6 +947,9 @@ QUICNetVConnection::state_connection_draining(int event, Event *data)
     break;
   case QUIC_EVENT_STATELESS_RESET:
     break;
+  case VC_EVENT_ACTIVE_TIMEOUT:
+    // Do nothing because closing is in progress
+    break;
   case QUIC_EVENT_ACK_PERIODIC:
   default:
     QUICConDebug("Unexpected event: %s (%d)", QUICDebugNames::quic_event(event), event);
@@ -2178,6 +2192,12 @@ QUICNetVConnection::_handle_idle_timeout()
 }
 
 void
+QUICNetVConnection::_handle_active_timeout()
+{
+  this->close_quic_connection(std::make_unique<QUICConnectionError>(QUICTransErrorCode::NO_ERROR, "Active Timeout"));
+}
+
+void
 QUICNetVConnection::_validate_new_path(const QUICPath &path)
 {
   // Not sure how long we should wait. The spec says just "enough time".