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

scw00 pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new 1d7d681  QUIC: Ensure switch to closed state once
1d7d681 is described below

commit 1d7d681cd5a6da686d88f066ce3897ad1a0b8c53
Author: scw00 <sc...@apache.org>
AuthorDate: Fri Mar 2 14:13:07 2018 +0800

    QUIC: Ensure switch to closed state once
---
 iocore/net/QUICNetVConnection.cc | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index f123c43..fcf57cf 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -465,13 +465,16 @@ QUICNetVConnection::handle_frame(std::shared_ptr<const 
QUICFrame> frame)
     break;
   case QUICFrameType::APPLICATION_CLOSE:
   case QUICFrameType::CONNECTION_CLOSE:
-    if (this->handler == 
reinterpret_cast<NetVConnHandler>(&QUICNetVConnection::state_connection_closing)
 ||
+    if (this->handler == 
reinterpret_cast<NetVConnHandler>(&QUICNetVConnection::state_connection_closed) 
||
         this->handler == 
reinterpret_cast<NetVConnHandler>(&QUICNetVConnection::state_connection_draining))
 {
-      this->_switch_to_close_state();
-    } else {
-      this->_switch_to_draining_state(QUICConnectionErrorUPtr(
-        new QUICConnectionError(std::static_pointer_cast<const 
QUICApplicationCloseFrame>(frame)->error_code())));
+      return error;
     }
+
+    // 7.9.1. Closing and Draining Connection States
+    // An endpoint MAY transition from the closing period to the draining 
period if it can confirm that its peer is also closing or
+    // draining. Receiving a closing frame is sufficient confirmation, as is 
receiving a stateless reset.
+    this->_switch_to_draining_state(QUICConnectionErrorUPtr(
+      new QUICConnectionError(std::static_pointer_cast<const 
QUICApplicationCloseFrame>(frame)->error_code())));
     break;
   default:
     QUICConDebug("Unexpected frame type: %02x", static_cast<unsigned 
int>(frame->type()));

-- 
To stop receiving notification emails like this one, please contact
sc...@apache.org.

Reply via email to