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 2018/04/05 03:22:00 UTC
[trafficserver] branch quic-latest updated (6ff1a3f -> 864da3b)
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a change to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.
from 6ff1a3f Add Version Negotiation support on QUIC client
new 5c7db9f Start handshake over when qvc received VERSION NEGOTIATION packet
new 864da3b Fix QUICHandshake::is_version_negotiated()
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
iocore/net/QUICNetVConnection.cc | 29 ++++++++++++++++++++++-------
iocore/net/quic/QUICHandshake.cc | 13 ++++++++++++-
iocore/net/quic/QUICHandshake.h | 1 +
3 files changed, 35 insertions(+), 8 deletions(-)
--
To stop receiving notification emails like this one, please contact
masaori@apache.org.
[trafficserver] 01/02: Start handshake over when qvc received
VERSION NEGOTIATION packet
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 5c7db9f3f6a9b68954798d07acb7a90eaff2dca5
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Thu Apr 5 11:08:26 2018 +0900
Start handshake over when qvc received VERSION NEGOTIATION packet
---
iocore/net/QUICNetVConnection.cc | 22 +++++++++++++++++++---
iocore/net/quic/QUICHandshake.cc | 10 ++++++++++
iocore/net/quic/QUICHandshake.h | 1 +
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 6ea5de4..e55e524 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -819,7 +819,16 @@ QUICNetVConnection::_state_handshake_process_version_negotiation_packet(QUICPack
}
error = this->_handshake_handler->negotiate_version(packet.get(), &this->_packet_factory);
- // Initial packet will be retransmited with negotiated version
+
+ // discard all transport state except packet number
+ this->_stream_manager->reset_send_offset();
+ this->_stream_manager->reset_recv_offset();
+ this->_loss_detector->reset();
+
+ // start handshake over
+ this->_handshake_handler->reset();
+ this->_handshake_handler->handleEvent(VC_EVENT_WRITE_READY, nullptr);
+ this->_schedule_packet_write_ready();
return error;
}
@@ -1234,6 +1243,7 @@ QUICNetVConnection::_build_packet(ats_unique_buf buf, size_t len, bool retransmi
// TODO: support NET_VCONNECTION_IN
if (this->get_context() == NET_VCONNECTION_OUT && type == QUICPacketType::UNINITIALIZED) {
if (this->_last_received_packet_type == QUICPacketType::UNINITIALIZED ||
+ this->_last_received_packet_type == QUICPacketType::VERSION_NEGOTIATION ||
this->_last_received_packet_type == QUICPacketType::RETRY) {
type = QUICPacketType::INITIAL;
} else if (_last_received_packet_type == QUICPacketType::HANDSHAKE) {
@@ -1377,9 +1387,15 @@ QUICNetVConnection::_dequeue_recv_packet(QUICPacketCreationResult &result)
QUICConDebug("Unsupported version");
break;
case QUICPacketCreationResult::SUCCESS:
- QUICConDebug("Dequeue %s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
- quic_packet->packet_number(), quic_packet->size());
this->_last_received_packet_type = quic_packet->type();
+
+ if (quic_packet->type() == QUICPacketType::VERSION_NEGOTIATION) {
+ QUICConDebug("Dequeue %s size=%u", QUICDebugNames::packet_type(quic_packet->type()), quic_packet->size());
+ } else {
+ QUICConDebug("Dequeue %s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
+ quic_packet->packet_number(), quic_packet->size());
+ }
+
break;
default:
QUICConDebug("Failed to decrypt the packet");
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 5d2484e..94b431e 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -374,6 +374,16 @@ QUICHandshake::msg_type() const
}
}
+/**
+ * reset states for starting over
+ */
+void
+QUICHandshake::reset()
+{
+ this->_initial = true;
+ SSL_clear(this->_ssl);
+}
+
void
QUICHandshake::_load_local_server_transport_parameters(QUICVersion negotiated_version)
{
diff --git a/iocore/net/quic/QUICHandshake.h b/iocore/net/quic/QUICHandshake.h
index 37e316e..5274a66 100644
--- a/iocore/net/quic/QUICHandshake.h
+++ b/iocore/net/quic/QUICHandshake.h
@@ -54,6 +54,7 @@ public:
// for client side
QUICErrorUPtr start(QUICPacketFactory *packet_factory, bool vn_exercise_enabled);
QUICErrorUPtr negotiate_version(const QUICPacket *packet, QUICPacketFactory *packet_factory);
+ void reset();
// for server side
QUICErrorUPtr start(const QUICPacket *initial_packet, QUICPacketFactory *packet_factory);
--
To stop receiving notification emails like this one, please contact
masaori@apache.org.
[trafficserver] 02/02: Fix QUICHandshake::is_version_negotiated()
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 864da3bde6765bc17943d8654010dd02635bc70c
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Thu Apr 5 12:19:06 2018 +0900
Fix QUICHandshake::is_version_negotiated()
To do not send ACK frame if VRESION NEGOTIATION packet was sent.
---
iocore/net/QUICNetVConnection.cc | 7 +++----
iocore/net/quic/QUICHandshake.cc | 3 ++-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index e55e524..4fcecd3 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -844,13 +844,12 @@ QUICNetVConnection::_state_handshake_process_initial_packet(QUICPacketUPtr packe
// Start handshake
QUICErrorUPtr error = this->_handshake_handler->start(packet.get(), &this->_packet_factory);
+
+ // If version negotiation was failed and VERSION NEGOTIATION packet was sent, nothing to do.
if (this->_handshake_handler->is_version_negotiated()) {
error = this->_recv_and_ack(std::move(packet));
- } else {
- // Perhaps response packets for initial packet were lost. Pass packet to _recv_and_ack to send ack to the initial packet.
- // Stream data will be discarded by offset mismatch.
- error = this->_recv_and_ack(std::move(packet));
}
+
return error;
}
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 94b431e..37ec334 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -186,7 +186,8 @@ QUICHandshake::negotiate_version(const QUICPacket *vn, QUICPacketFactory *packet
bool
QUICHandshake::is_version_negotiated() const
{
- return (this->_version_negotiator->status() == QUICVersionNegotiationStatus::NEGOTIATED);
+ return (this->_version_negotiator->status() == QUICVersionNegotiationStatus::NEGOTIATED ||
+ this->_version_negotiator->status() == QUICVersionNegotiationStatus::VALIDATED);
}
bool
--
To stop receiving notification emails like this one, please contact
masaori@apache.org.