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

Side by Side Diff: net/quic/quic_crypto_server_stream.cc

Issue 1424653008: Make QUIC stateless rejects work in the face of packet loss by storing the SREJ packet(s) in the Qu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106432163
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/test_tools/quic_connection_peer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_crypto_server_stream.h" 5 #include "net/quic/quic_crypto_server_stream.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "crypto/secure_hash.h" 8 #include "crypto/secure_hash.h"
9 #include "net/quic/crypto/crypto_protocol.h" 9 #include "net/quic/crypto/crypto_protocol.h"
10 #include "net/quic/crypto/crypto_utils.h" 10 #include "net/quic/crypto/crypto_utils.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 string error_details; 101 string error_details;
102 QuicErrorCode error = 102 QuicErrorCode error =
103 ProcessClientHello(message, result, &reply, &error_details); 103 ProcessClientHello(message, result, &reply, &error_details);
104 104
105 if (error != QUIC_NO_ERROR) { 105 if (error != QUIC_NO_ERROR) {
106 CloseConnectionWithDetails(error, error_details); 106 CloseConnectionWithDetails(error, error_details);
107 return; 107 return;
108 } 108 }
109 109
110 if (reply.tag() != kSHLO) { 110 if (reply.tag() != kSHLO) {
111 if (FLAGS_enable_quic_stateless_reject_support &&
112 reply.tag() == kSREJ) {
113 // Before sending the SREJ, cause the connection to save crypto packets
114 // so that they can be added to the time wait list manager and
115 // retransmitted.
116 session()->connection()->EnableSavingCryptoPackets();
117 }
111 SendHandshakeMessage(reply); 118 SendHandshakeMessage(reply);
112 119
113 if (FLAGS_enable_quic_stateless_reject_support && reply.tag() == kSREJ) { 120 if (FLAGS_enable_quic_stateless_reject_support && reply.tag() == kSREJ) {
114 DCHECK(use_stateless_rejects_if_peer_supported()); 121 DCHECK(use_stateless_rejects_if_peer_supported());
115 DCHECK(peer_supports_stateless_rejects()); 122 DCHECK(peer_supports_stateless_rejects());
116 DCHECK(!handshake_confirmed()); 123 DCHECK(!handshake_confirmed());
117 DVLOG(1) << "Closing connection " 124 DVLOG(1) << "Closing connection "
118 << session()->connection()->connection_id() 125 << session()->connection()->connection_id()
119 << " because of a stateless reject."; 126 << " because of a stateless reject.";
120 session()->connection()->CloseConnection( 127 session()->connection()->CloseConnection(
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 319 }
313 for (size_t i = 0; i < received_tags_length; ++i) { 320 for (size_t i = 0; i < received_tags_length; ++i) {
314 if (received_tags[i] == kSREJ) { 321 if (received_tags[i] == kSREJ) {
315 return true; 322 return true;
316 } 323 }
317 } 324 }
318 return false; 325 return false;
319 } 326 }
320 327
321 } // namespace net 328 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/test_tools/quic_connection_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698