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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 void QuicCryptoStream::OnError(CryptoFramer* framer) { | 28 void QuicCryptoStream::OnError(CryptoFramer* framer) { |
29 DLOG(WARNING) << "Error processing crypto data: " | 29 DLOG(WARNING) << "Error processing crypto data: " |
30 << QuicUtils::ErrorToString(framer->error()); | 30 << QuicUtils::ErrorToString(framer->error()); |
31 } | 31 } |
32 | 32 |
33 void QuicCryptoStream::OnHandshakeMessage( | 33 void QuicCryptoStream::OnHandshakeMessage( |
34 const CryptoHandshakeMessage& message) { | 34 const CryptoHandshakeMessage& message) { |
35 session()->OnCryptoHandshakeMessageReceived(message); | 35 session()->OnCryptoHandshakeMessageReceived(message); |
36 } | 36 } |
37 | 37 |
38 uint32 QuicCryptoStream::ProcessRawData(const char* data, | 38 uint32 QuicCryptoStream::ProcessRawData(const char* data, uint32 data_len) { |
39 uint32 data_len) { | |
40 // Do not process handshake messages after the handshake is confirmed. | 39 // Do not process handshake messages after the handshake is confirmed. |
41 if (handshake_confirmed()) { | 40 if (handshake_confirmed()) { |
42 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); | 41 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); |
43 return 0; | 42 return 0; |
44 } | 43 } |
45 if (!crypto_framer_.ProcessInput(StringPiece(data, data_len))) { | 44 if (!crypto_framer_.ProcessInput(StringPiece(data, data_len))) { |
46 CloseConnection(crypto_framer_.error()); | 45 CloseConnection(crypto_framer_.error()); |
47 return 0; | 46 return 0; |
48 } | 47 } |
49 return data_len; | 48 return data_len; |
(...skipping 14 matching lines...) Expand all Loading... |
64 WriteOrBufferData(string(data.data(), data.length()), false, NULL); | 63 WriteOrBufferData(string(data.data(), data.length()), false, NULL); |
65 session()->connection()->Flush(); | 64 session()->connection()->Flush(); |
66 } | 65 } |
67 | 66 |
68 const QuicCryptoNegotiatedParameters& | 67 const QuicCryptoNegotiatedParameters& |
69 QuicCryptoStream::crypto_negotiated_params() const { | 68 QuicCryptoStream::crypto_negotiated_params() const { |
70 return crypto_negotiated_params_; | 69 return crypto_negotiated_params_; |
71 } | 70 } |
72 | 71 |
73 } // namespace net | 72 } // namespace net |
OLD | NEW |