mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-09 10:00:57 +03:00
Clean up initial/handshake ciphers a little more intelligently.
Summary: Right now we are running the handshakeConfirmed code a lot on the client. This is excessive. We only need to run the code if we haven't already dropped the cipher. Reviewed By: yangchi Differential Revision: D27725974 fbshipit-source-id: ca325c132debdd280e447ca30876488b879ff13c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
02d41d8ee7
commit
b16c3b306b
@@ -1664,4 +1664,10 @@ void handshakeConfirmed(QuicConnectionStateBase& conn) {
|
||||
implicitAckCryptoStream(conn, EncryptionLevel::Handshake);
|
||||
}
|
||||
|
||||
bool hasInitialOrHandshakeCiphers(QuicConnectionStateBase& conn) {
|
||||
return conn.initialWriteCipher || conn.handshakeWriteCipher ||
|
||||
conn.readCodec->getInitialCipher() ||
|
||||
conn.readCodec->getHandshakeReadCipher();
|
||||
}
|
||||
|
||||
} // namespace quic
|
||||
|
||||
@@ -310,6 +310,7 @@ void implicitAckCryptoStream(
|
||||
QuicConnectionStateBase& conn,
|
||||
EncryptionLevel encryptionLevel);
|
||||
void handshakeConfirmed(QuicConnectionStateBase& conn);
|
||||
bool hasInitialOrHandshakeCiphers(QuicConnectionStateBase& conn);
|
||||
|
||||
bool writeLoopTimeLimit(
|
||||
TimePoint loopBeginTime,
|
||||
|
||||
@@ -377,9 +377,7 @@ void QuicClientTransport::processPacketData(
|
||||
// finished message. We can mark the handshake as confirmed and
|
||||
// drop the handshake cipher and outstanding packets after the
|
||||
// processing loop.
|
||||
if (conn_->handshakeWriteCipher) {
|
||||
conn_->handshakeLayer->handshakeConfirmed();
|
||||
}
|
||||
// TODO reap
|
||||
if (*conn_->version == QuicVersion::MVFST_D24) {
|
||||
cancelHandshakeCryptoStreamRetransmissions(
|
||||
@@ -583,7 +581,8 @@ void QuicClientTransport::processPacketData(
|
||||
|
||||
auto handshakeLayer = clientConn_->clientHandshakeLayer;
|
||||
if (handshakeLayer->getPhase() == ClientHandshake::Phase::Established &&
|
||||
*conn_->version != QuicVersion::MVFST_D24) {
|
||||
*conn_->version != QuicVersion::MVFST_D24 &&
|
||||
hasInitialOrHandshakeCiphers(*conn_)) {
|
||||
handshakeConfirmed(*conn_);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user