OLD | NEW |
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/core/quic_crypto_server_stream.h" | 5 #include "net/quic/core/quic_crypto_server_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "net/quic/core/crypto/crypto_protocol.h" | 9 #include "net/quic/core/crypto/crypto_protocol.h" |
10 #include "net/quic/core/crypto/crypto_utils.h" | 10 #include "net/quic/core/crypto/crypto_utils.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 }; | 57 }; |
58 | 58 |
59 QuicCryptoServerStreamBase::QuicCryptoServerStreamBase(QuicSession* session) | 59 QuicCryptoServerStreamBase::QuicCryptoServerStreamBase(QuicSession* session) |
60 : QuicCryptoStream(session) {} | 60 : QuicCryptoStream(session) {} |
61 | 61 |
62 // TODO(jokulik): Once stateless rejects support is inherent in the version | 62 // TODO(jokulik): Once stateless rejects support is inherent in the version |
63 // number, this function will likely go away entirely. | 63 // number, this function will likely go away entirely. |
64 // static | 64 // static |
65 bool QuicCryptoServerStreamBase::DoesPeerSupportStatelessRejects( | 65 bool QuicCryptoServerStreamBase::DoesPeerSupportStatelessRejects( |
66 const CryptoHandshakeMessage& message) { | 66 const CryptoHandshakeMessage& message) { |
67 const QuicTag* received_tags; | 67 QuicTagVector received_tags; |
68 size_t received_tags_length; | 68 QuicErrorCode error = message.GetTaglist(kCOPT, &received_tags); |
69 QuicErrorCode error = | |
70 message.GetTaglist(kCOPT, &received_tags, &received_tags_length); | |
71 if (error != QUIC_NO_ERROR) { | 69 if (error != QUIC_NO_ERROR) { |
72 return false; | 70 return false; |
73 } | 71 } |
74 for (size_t i = 0; i < received_tags_length; ++i) { | 72 for (const QuicTag tag : received_tags) { |
75 if (received_tags[i] == kSREJ) { | 73 if (tag == kSREJ) { |
76 return true; | 74 return true; |
77 } | 75 } |
78 } | 76 } |
79 return false; | 77 return false; |
80 } | 78 } |
81 | 79 |
82 QuicCryptoServerStream::QuicCryptoServerStream( | 80 QuicCryptoServerStream::QuicCryptoServerStream( |
83 const QuicCryptoServerConfig* crypto_config, | 81 const QuicCryptoServerConfig* crypto_config, |
84 QuicCompressedCertsCache* compressed_certs_cache, | 82 QuicCompressedCertsCache* compressed_certs_cache, |
85 bool use_stateless_rejects_if_peer_supported, | 83 bool use_stateless_rejects_if_peer_supported, |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 } | 476 } |
479 return helper_->GenerateConnectionIdForReject( | 477 return helper_->GenerateConnectionIdForReject( |
480 session()->connection()->connection_id()); | 478 session()->connection()->connection_id()); |
481 } | 479 } |
482 | 480 |
483 const QuicSocketAddress QuicCryptoServerStream::GetClientAddress() { | 481 const QuicSocketAddress QuicCryptoServerStream::GetClientAddress() { |
484 return session()->connection()->peer_address(); | 482 return session()->connection()->peer_address(); |
485 } | 483 } |
486 | 484 |
487 } // namespace net | 485 } // namespace net |
OLD | NEW |