| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/crypto/quic_crypto_client_config.h" | 5 #include "net/quic/crypto/quic_crypto_client_config.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 return error; | 662 return error; |
| 663 } | 663 } |
| 664 | 664 |
| 665 StringPiece nonce; | 665 StringPiece nonce; |
| 666 if (rej.GetStringPiece(kServerNonceTag, &nonce)) { | 666 if (rej.GetStringPiece(kServerNonceTag, &nonce)) { |
| 667 out_params->server_nonce = nonce.as_string(); | 667 out_params->server_nonce = nonce.as_string(); |
| 668 } | 668 } |
| 669 | 669 |
| 670 const uint32* reject_reasons; | 670 const uint32* reject_reasons; |
| 671 size_t num_reject_reasons; | 671 size_t num_reject_reasons; |
| 672 COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync); | 672 static_assert(sizeof(QuicTag) == sizeof(uint32), "header out of sync"); |
| 673 if (rej.GetTaglist(kRREJ, &reject_reasons, | 673 if (rej.GetTaglist(kRREJ, &reject_reasons, |
| 674 &num_reject_reasons) == QUIC_NO_ERROR) { | 674 &num_reject_reasons) == QUIC_NO_ERROR) { |
| 675 uint32 packed_error = 0; | 675 uint32 packed_error = 0; |
| 676 for (size_t i = 0; i < num_reject_reasons; ++i) { | 676 for (size_t i = 0; i < num_reject_reasons; ++i) { |
| 677 // HANDSHAKE_OK is 0 and don't report that as error. | 677 // HANDSHAKE_OK is 0 and don't report that as error. |
| 678 if (reject_reasons[i] == HANDSHAKE_OK || reject_reasons[i] >= 32) { | 678 if (reject_reasons[i] == HANDSHAKE_OK || reject_reasons[i] >= 32) { |
| 679 continue; | 679 continue; |
| 680 } | 680 } |
| 681 HandshakeFailureReason reason = | 681 HandshakeFailureReason reason = |
| 682 static_cast<HandshakeFailureReason>(reject_reasons[i]); | 682 static_cast<HandshakeFailureReason>(reject_reasons[i]); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 } | 869 } |
| 870 | 870 |
| 871 // Update canonical version to point at the "most recent" entry. | 871 // Update canonical version to point at the "most recent" entry. |
| 872 canonical_server_map_[suffix_server_id] = server_id; | 872 canonical_server_map_[suffix_server_id] = server_id; |
| 873 | 873 |
| 874 server_state->InitializeFrom(*canonical_state); | 874 server_state->InitializeFrom(*canonical_state); |
| 875 return true; | 875 return true; |
| 876 } | 876 } |
| 877 | 877 |
| 878 } // namespace net | 878 } // namespace net |
| OLD | NEW |