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 2017/10/19 01:56:39 UTC
[trafficserver] branch quic-latest updated: Don't free
QUICNetVConnection for now to prevent crashes
This is an automated email from the ASF dual-hosted git repository.
maskit 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 ba7974d Don't free QUICNetVConnection for now to prevent crashes
ba7974d is described below
commit ba7974de6e5b577f98945de8136130b6b43982bc
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Thu Oct 19 10:51:51 2017 +0900
Don't free QUICNetVConnection for now to prevent crashes
Since we don't have QUICNetHandler, all IO events are handled by QUICNetVC
directly, which causes crashes when the events are processed after freeing
QUICNetVC. It is going to be addressed by introducing QUICNetHandler.
---
iocore/net/P_QUICNetVConnection.h | 1 +
iocore/net/P_QUICPacketHandler.h | 1 -
iocore/net/QUICNetVConnection.cc | 15 ++++++++++-----
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h
index c249d20..92c84ee 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -170,6 +170,7 @@ public:
// QUICNetVConnection
void registerNextProtocolSet(SSLNextProtocolSet *s);
+ bool is_closed();
// QUICConnection
QUICConnectionId connection_id() override;
diff --git a/iocore/net/P_QUICPacketHandler.h b/iocore/net/P_QUICPacketHandler.h
index 113a31c..e1ea3fb 100644
--- a/iocore/net/P_QUICPacketHandler.h
+++ b/iocore/net/P_QUICPacketHandler.h
@@ -42,7 +42,6 @@ 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 90ccb7b..45c8aed 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -123,8 +123,6 @@ QUICNetVConnection::free(EThread *t)
{
DebugQUICCon("Free connection");
- this->_packet_handler->forget(this);
-
this->_udp_con = nullptr;
this->_packet_handler = nullptr;
@@ -537,7 +535,10 @@ QUICNetVConnection::state_connection_closed(int event, Event *data)
{
switch (event) {
case QUIC_EVENT_SHUTDOWN: {
- this->_packet_write_ready = nullptr;
+ if (this->_packet_write_ready) {
+ this->_packet_write_ready->cancel();
+ this->_packet_write_ready = nullptr;
+ }
this->next_inactivity_timeout_at = 0;
this->next_activity_timeout_at = 0;
@@ -548,8 +549,6 @@ QUICNetVConnection::state_connection_closed(int event, Event *data)
// Shutdown loss detector
this->_loss_detector->handleEvent(QUIC_EVENT_LD_SHUTDOWN, nullptr);
- this->free(this_ethread());
-
break;
}
default:
@@ -616,6 +615,12 @@ QUICNetVConnection::registerNextProtocolSet(SSLNextProtocolSet *s)
this->_next_protocol_set = s;
}
+bool
+QUICNetVConnection::is_closed()
+{
+ return this->handler == reinterpret_cast<NetVConnHandler>(&QUICNetVConnection::state_connection_closed);
+}
+
SSLNextProtocolSet *
QUICNetVConnection::next_protocol_set()
{
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].