Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Unified Diff: net/quic/test_tools/mock_crypto_client_stream.cc

Issue 14083012: QUIC: retransmit packets with the correct encryption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved HandshakeMode enum to MockCryptoClientStream Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/test_tools/mock_crypto_client_stream.cc
diff --git a/net/quic/test_tools/mock_crypto_client_stream.cc b/net/quic/test_tools/mock_crypto_client_stream.cc
index c63d0f01ede89057d0aa0df4a08a951ad3e14e97..8ac7c12641366761cd2c78349e649a5590b34fb2 100644
--- a/net/quic/test_tools/mock_crypto_client_stream.cc
+++ b/net/quic/test_tools/mock_crypto_client_stream.cc
@@ -10,8 +10,10 @@ MockCryptoClientStream::MockCryptoClientStream(
const string& server_hostname,
const QuicConfig& config,
QuicSession* session,
- QuicCryptoClientConfig* crypto_config)
- : QuicCryptoClientStream(server_hostname, config, session, crypto_config) {
+ QuicCryptoClientConfig* crypto_config,
+ HandshakeMode handshake_mode)
+ : QuicCryptoClientStream(server_hostname, config, session, crypto_config),
+ handshake_mode_(handshake_mode) {
}
MockCryptoClientStream::~MockCryptoClientStream() {
@@ -23,7 +25,17 @@ void MockCryptoClientStream::OnHandshakeMessage(
}
bool MockCryptoClientStream::CryptoConnect() {
- SetHandshakeComplete(QUIC_NO_ERROR);
+ if (handshake_mode_ == ZERO_RTT) {
+ encryption_established_ = true;
+ handshake_confirmed_ = false;
+ session()->OnCryptoHandshakeEvent(
+ QuicSession::ENCRYPTION_FIRST_ESTABLISHED);
+ return true;
+ }
+
+ encryption_established_ = true;
+ handshake_confirmed_ = true;
+ session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698