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/quic_connection.h" | 11 #include "net/quic/quic_connection.h" |
12 #include "net/quic/quic_session.h" | 12 #include "net/quic/quic_session.h" |
13 #include "net/quic/quic_utils.h" | 13 #include "net/quic/quic_utils.h" |
14 | 14 |
15 using std::string; | 15 using std::string; |
16 using base::StringPiece; | 16 using base::StringPiece; |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 QuicCryptoStream::QuicCryptoStream(QuicSession* session) | 20 QuicCryptoStream::QuicCryptoStream(QuicSession* session) |
21 : ReliableQuicStream(kCryptoStreamId, session), | 21 : ReliableQuicStream(kCryptoStreamId, session), |
22 encryption_established_(false), | 22 encryption_established_(false), |
23 handshake_confirmed_(false) { | 23 handshake_confirmed_(false) { |
24 crypto_framer_.set_visitor(this); | 24 crypto_framer_.set_visitor(this); |
25 DisableFlowControl(); | 25 if (version() <= QUIC_VERSION_20) { |
| 26 // Prior to QUIC_VERSION_21 the crypto stream is not subject to any flow |
| 27 // control. |
| 28 DisableFlowControl(); |
| 29 } |
| 30 // The crypto stream is exempt from connection level flow control. |
| 31 DisableConnectionFlowControlForThisStream(); |
26 } | 32 } |
27 | 33 |
28 void QuicCryptoStream::OnError(CryptoFramer* framer) { | 34 void QuicCryptoStream::OnError(CryptoFramer* framer) { |
29 DLOG(WARNING) << "Error processing crypto data: " | 35 DLOG(WARNING) << "Error processing crypto data: " |
30 << QuicUtils::ErrorToString(framer->error()); | 36 << QuicUtils::ErrorToString(framer->error()); |
31 } | 37 } |
32 | 38 |
33 void QuicCryptoStream::OnHandshakeMessage( | 39 void QuicCryptoStream::OnHandshakeMessage( |
34 const CryptoHandshakeMessage& message) { | 40 const CryptoHandshakeMessage& message) { |
35 session()->OnCryptoHandshakeMessageReceived(message); | 41 session()->OnCryptoHandshakeMessageReceived(message); |
(...skipping 24 matching lines...) Expand all Loading... |
60 // TODO(wtc): check the return value. | 66 // TODO(wtc): check the return value. |
61 WriteOrBufferData(string(data.data(), data.length()), false, NULL); | 67 WriteOrBufferData(string(data.data(), data.length()), false, NULL); |
62 } | 68 } |
63 | 69 |
64 const QuicCryptoNegotiatedParameters& | 70 const QuicCryptoNegotiatedParameters& |
65 QuicCryptoStream::crypto_negotiated_params() const { | 71 QuicCryptoStream::crypto_negotiated_params() const { |
66 return crypto_negotiated_params_; | 72 return crypto_negotiated_params_; |
67 } | 73 } |
68 | 74 |
69 } // namespace net | 75 } // namespace net |
OLD | NEW |