You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sc...@apache.org on 2018/03/12 00:25:17 UTC
[trafficserver] branch quic-latest updated: QUIC: Make sure only
schedule one event when close connection
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 f8aa0df QUIC: Make sure only schedule one event when close connection
f8aa0df is described below
commit f8aa0dfc4c5077a101bbba928cf21278df14a09d
Author: scw00 <sc...@apache.org>
AuthorDate: Sun Mar 11 08:47:52 2018 +0800
QUIC: Make sure only schedule one event when close connection
---
iocore/net/P_QUICNetVConnection.h | 5 +++++
iocore/net/QUICNetVConnection.cc | 28 +++++++++++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h
index 59677de..c787e65 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -271,6 +271,11 @@ private:
void _close_closing_timeout(Event *data);
Event *_closing_timeout = nullptr;
+ void _schedule_closed_event();
+ void _unschedule_closed_event();
+ void _close_closed_event(Event *data);
+ Event *_closed_event = nullptr;
+
uint32_t _transmit_packet(QUICPacketUPtr);
void _transmit_frame(QUICFrameUPtr);
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 7a712d7..95e52ef 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -660,6 +660,7 @@ QUICNetVConnection::state_connection_closed(int event, Event *data)
case QUIC_EVENT_SHUTDOWN: {
this->_unschedule_packet_write_ready();
this->_unschedule_closing_timeout();
+ this->_close_closed_event(data);
this->next_inactivity_timeout_at = 0;
this->next_activity_timeout_at = 0;
@@ -1277,6 +1278,31 @@ QUICNetVConnection::_close_closing_timeout(Event *data)
this->_closing_timeout = nullptr;
}
+void
+QUICNetVConnection::_schedule_closed_event()
+{
+ if (!this->_closed_event) {
+ QUICConDebug("Schedule %s event", QUICDebugNames::quic_event(QUIC_EVENT_SHUTDOWN));
+ this->_closed_event = this_ethread()->schedule_imm(this, QUIC_EVENT_SHUTDOWN, nullptr);
+ }
+}
+
+void
+QUICNetVConnection::_unschedule_closed_event()
+{
+ if (!this->_closed_event) {
+ this->_closed_event->cancel();
+ this->_closed_event = nullptr;
+ }
+}
+
+void
+QUICNetVConnection::_close_closed_event(Event *data)
+{
+ ink_assert(this->_closed_event == data);
+ this->_closed_event = nullptr;
+}
+
int
QUICNetVConnection::_complete_handshake_if_possible()
{
@@ -1405,7 +1431,7 @@ QUICNetVConnection::_switch_to_close_state()
}
QUICConDebug("Enter state_connection_closed");
SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_closed);
- this_ethread()->schedule_imm(this, QUIC_EVENT_SHUTDOWN, nullptr);
+ this->_schedule_closed_event();
}
void
--
To stop receiving notification emails like this one, please contact
scw00@apache.org.