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/quic_crypto_stream.h" | 5 #include "net/quic/quic_crypto_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "net/quic/crypto/crypto_handshake.h" | 10 #include "net/quic/crypto/crypto_handshake.h" |
11 #include "net/quic/crypto/crypto_utils.h" | 11 #include "net/quic/crypto/crypto_utils.h" |
12 #include "net/quic/quic_connection.h" | 12 #include "net/quic/quic_connection.h" |
13 #include "net/quic/quic_session.h" | 13 #include "net/quic/quic_session.h" |
14 #include "net/quic/quic_utils.h" | 14 #include "net/quic/quic_utils.h" |
15 | 15 |
16 using std::string; | 16 using std::string; |
17 using base::StringPiece; | 17 using base::StringPiece; |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 #define ENDPOINT (session()->is_server() ? "Server: " : " Client: ") | 21 #define ENDPOINT (session()->is_server() ? "Server: " : " Client: ") |
22 | 22 |
23 QuicCryptoStream::QuicCryptoStream(QuicSession* session) | 23 QuicCryptoStream::QuicCryptoStream(QuicSession* session) |
24 : ReliableQuicStream(kCryptoStreamId, session), | 24 : ReliableQuicStream(kCryptoStreamId, session), |
25 encryption_established_(false), | 25 encryption_established_(false), |
26 handshake_confirmed_(false) { | 26 handshake_confirmed_(false) { |
27 crypto_framer_.set_visitor(this); | 27 crypto_framer_.set_visitor(this); |
28 if (version() < QUIC_VERSION_21) { | |
29 // Prior to QUIC_VERSION_21 the crypto stream is not subject to any flow | |
30 // control. | |
31 DisableFlowControl(); | |
32 } | |
33 // The crypto stream is exempt from connection level flow control. | 28 // The crypto stream is exempt from connection level flow control. |
34 DisableConnectionFlowControlForThisStream(); | 29 DisableConnectionFlowControlForThisStream(); |
35 } | 30 } |
36 | 31 |
37 void QuicCryptoStream::OnError(CryptoFramer* framer) { | 32 void QuicCryptoStream::OnError(CryptoFramer* framer) { |
38 DLOG(WARNING) << "Error processing crypto data: " | 33 DLOG(WARNING) << "Error processing crypto data: " |
39 << QuicUtils::ErrorToString(framer->error()); | 34 << QuicUtils::ErrorToString(framer->error()); |
40 } | 35 } |
41 | 36 |
42 void QuicCryptoStream::OnHandshakeMessage( | 37 void QuicCryptoStream::OnHandshakeMessage( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 result_len, | 85 result_len, |
91 result); | 86 result); |
92 } | 87 } |
93 | 88 |
94 const QuicCryptoNegotiatedParameters& | 89 const QuicCryptoNegotiatedParameters& |
95 QuicCryptoStream::crypto_negotiated_params() const { | 90 QuicCryptoStream::crypto_negotiated_params() const { |
96 return crypto_negotiated_params_; | 91 return crypto_negotiated_params_; |
97 } | 92 } |
98 | 93 |
99 } // namespace net | 94 } // namespace net |
OLD | NEW |