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/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "net/quic/crypto/cert_compressor.h" | 9 #include "net/quic/crypto/cert_compressor.h" |
10 #include "net/quic/crypto/channel_id.h" | 10 #include "net/quic/crypto/channel_id.h" |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 DCHECK(server_state->IsEmpty()); | 691 DCHECK(server_state->IsEmpty()); |
692 unsigned i = 0; | 692 unsigned i = 0; |
693 for (; i < canoncial_suffixes_.size(); ++i) { | 693 for (; i < canoncial_suffixes_.size(); ++i) { |
694 if (EndsWith(server_key.host(), canoncial_suffixes_[i], false)) { | 694 if (EndsWith(server_key.host(), canoncial_suffixes_[i], false)) { |
695 break; | 695 break; |
696 } | 696 } |
697 } | 697 } |
698 if (i == canoncial_suffixes_.size()) | 698 if (i == canoncial_suffixes_.size()) |
699 return; | 699 return; |
700 | 700 |
701 QuicSessionKey suffix_server_key( | 701 QuicSessionKey suffix_server_key(canoncial_suffixes_[i], server_key.port(), |
702 canoncial_suffixes_[i], server_key.port(), server_key.is_https()); | 702 server_key.is_https(), |
| 703 server_key.privacy_mode()); |
703 if (!ContainsKey(canonical_server_map_, suffix_server_key)) { | 704 if (!ContainsKey(canonical_server_map_, suffix_server_key)) { |
704 // This is the first host we've seen which matches the suffix, so make it | 705 // This is the first host we've seen which matches the suffix, so make it |
705 // canonical. | 706 // canonical. |
706 canonical_server_map_[suffix_server_key] = server_key; | 707 canonical_server_map_[suffix_server_key] = server_key; |
707 return; | 708 return; |
708 } | 709 } |
709 | 710 |
710 const QuicSessionKey& canonical_server_key = | 711 const QuicSessionKey& canonical_server_key = |
711 canonical_server_map_[suffix_server_key]; | 712 canonical_server_map_[suffix_server_key]; |
712 CachedState* canonical_state = cached_states_[canonical_server_key]; | 713 CachedState* canonical_state = cached_states_[canonical_server_key]; |
713 if (!canonical_state->proof_valid()) { | 714 if (!canonical_state->proof_valid()) { |
714 return; | 715 return; |
715 } | 716 } |
716 | 717 |
717 // Update canonical version to point at the "most recent" entry. | 718 // Update canonical version to point at the "most recent" entry. |
718 canonical_server_map_[suffix_server_key] = server_key; | 719 canonical_server_map_[suffix_server_key] = server_key; |
719 | 720 |
720 server_state->InitializeFrom(*canonical_state); | 721 server_state->InitializeFrom(*canonical_state); |
721 } | 722 } |
722 | 723 |
723 } // namespace net | 724 } // namespace net |
OLD | NEW |