trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mas...@apache.org
Subject [trafficserver] branch quic-05 updated: Remove QUICNetVConnection from the map when the connection has been freed
Date Sat, 30 Sep 2017 13:11:06 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/quic-05 by this push:
     new cfdb638  Remove QUICNetVConnection from the map when the connection has been freed
cfdb638 is described below

commit cfdb638edff615633cb303e67134154e37481dd8
Author: Masakazu Kitajo <maskit@apache.org>
AuthorDate: Sat Sep 30 22:01:18 2017 +0900

    Remove QUICNetVConnection from the map when the connection has been freed
    
    (cherry picked from commit 0551bfdb9673b71cbfd64c5fb59c502c82ee60b4)
---
 iocore/net/P_QUICNetVConnection.h | 1 +
 iocore/net/P_QUICPacketHandler.h  | 1 +
 iocore/net/QUICNetVConnection.cc  | 8 ++++++++
 iocore/net/QUICPacketHandler.cc   | 6 ++++++
 iocore/net/quic/Mock.h            | 7 +++++++
 iocore/net/quic/QUICConnection.h  | 2 ++
 6 files changed, 25 insertions(+)

diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h
index 7db4cd8..82b89fc 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -170,6 +170,7 @@ public:
   void registerNextProtocolSet(SSLNextProtocolSet *s);
 
   // QUICConnection
+  QUICConnectionId connection_id() override;
   uint32_t maximum_quic_packet_size() override;
   uint32_t minimum_quic_packet_size() override;
   uint32_t maximum_stream_frame_data_size() override;
diff --git a/iocore/net/P_QUICPacketHandler.h b/iocore/net/P_QUICPacketHandler.h
index e1ea3fb..113a31c 100644
--- a/iocore/net/P_QUICPacketHandler.h
+++ b/iocore/net/P_QUICPacketHandler.h
@@ -42,6 +42,7 @@ public:
   void init_accept(EThread *t) override;
   void send_packet(const QUICPacket &packet, QUICNetVConnection *vc);
   void send_packet(const QUICPacket &packet, UDPConnection *udp_con, IpEndpoint &addr,
uint32_t pmtu);
+  void forget(QUICNetVConnection *vc);
 
 private:
   void _recv_packet(int event, UDPPacket *udpPacket);
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index c0b2848..39ad79c 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -123,6 +123,8 @@ QUICNetVConnection::free(EThread *t)
 {
   DebugQUICCon("Free connection");
 
+  this->_packet_handler->forget(this);
+
   this->_udp_con        = nullptr;
   this->_packet_handler = nullptr;
 
@@ -151,6 +153,12 @@ QUICNetVConnection::reenable(VIO *vio)
   return;
 }
 
+QUICConnectionId
+QUICNetVConnection::connection_id()
+{
+  return this->_quic_connection_id;
+}
+
 uint32_t
 QUICNetVConnection::pmtu()
 {
diff --git a/iocore/net/QUICPacketHandler.cc b/iocore/net/QUICPacketHandler.cc
index 7dee08c..641dba2 100644
--- a/iocore/net/QUICPacketHandler.cc
+++ b/iocore/net/QUICPacketHandler.cc
@@ -199,3 +199,9 @@ QUICPacketHandler::send_packet(const QUICPacket &packet, UDPConnection
*udp_con,
 
   udp_con->send(this, udpPkt);
 }
+
+void
+QUICPacketHandler::forget(QUICNetVConnection *vc)
+{
+  this->_connections.put(vc->connection_id(), nullptr);
+}
diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index ea5163f..41d5390 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -144,6 +144,13 @@ public:
   {
     this->_mutex = new_ProxyMutex();
   };
+
+  QUICConnectionId
+  connection_id() override
+  {
+    return 0;
+  }
+
   void
   transmit_packet(QUICPacketUPtr packet) override
   {
diff --git a/iocore/net/quic/QUICConnection.h b/iocore/net/quic/QUICConnection.h
index e0bb194..93634ad 100644
--- a/iocore/net/quic/QUICConnection.h
+++ b/iocore/net/quic/QUICConnection.h
@@ -35,6 +35,8 @@ class SSLNextProtocolSet;
 class QUICConnection : public QUICPacketTransmitter, public QUICFrameTransmitter, public
QUICFrameHandler
 {
 public:
+  virtual QUICConnectionId connection_id() = 0;
+
   /*
    * Retruns the maximum packet size at the time called
    *

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message