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_stream.h" | 5 #include "net/quic/core/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/core/crypto/crypto_handshake.h" | 10 #include "net/quic/core/crypto/crypto_handshake.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // No more data to read. | 62 // No more data to read. |
63 break; | 63 break; |
64 } | 64 } |
65 StringPiece data(static_cast<char*>(iov.iov_base), iov.iov_len); | 65 StringPiece data(static_cast<char*>(iov.iov_base), iov.iov_len); |
66 if (!crypto_framer_.ProcessInput(data)) { | 66 if (!crypto_framer_.ProcessInput(data)) { |
67 CloseConnectionWithDetails(crypto_framer_.error(), | 67 CloseConnectionWithDetails(crypto_framer_.error(), |
68 crypto_framer_.error_detail()); | 68 crypto_framer_.error_detail()); |
69 return; | 69 return; |
70 } | 70 } |
71 sequencer()->MarkConsumed(iov.iov_len); | 71 sequencer()->MarkConsumed(iov.iov_len); |
72 if (handshake_confirmed_ && crypto_framer_.InputBytesRemaining() == 0) { | 72 if (handshake_confirmed_ && crypto_framer_.InputBytesRemaining() == 0 && |
| 73 FLAGS_quic_release_crypto_stream_buffer) { |
73 // If the handshake is complete and the current message has been fully | 74 // If the handshake is complete and the current message has been fully |
74 // processed then no more handshake messages are likely to arrive soon | 75 // processed then no more handshake messages are likely to arrive soon |
75 // so release the memory in the stream sequencer. | 76 // so release the memory in the stream sequencer. |
76 sequencer()->ReleaseBufferIfEmpty(); | 77 sequencer()->ReleaseBufferIfEmpty(); |
77 } | 78 } |
78 } | 79 } |
79 } | 80 } |
80 | 81 |
81 void QuicCryptoStream::SendHandshakeMessage( | 82 void QuicCryptoStream::SendHandshakeMessage( |
82 const CryptoHandshakeMessage& message) { | 83 const CryptoHandshakeMessage& message) { |
(...skipping 28 matching lines...) Expand all Loading... |
111 crypto_negotiated_params_.initial_subkey_secret, "EXPORTER-Token-Binding", | 112 crypto_negotiated_params_.initial_subkey_secret, "EXPORTER-Token-Binding", |
112 /* context= */ "", 32, result); | 113 /* context= */ "", 32, result); |
113 } | 114 } |
114 | 115 |
115 const QuicCryptoNegotiatedParameters& | 116 const QuicCryptoNegotiatedParameters& |
116 QuicCryptoStream::crypto_negotiated_params() const { | 117 QuicCryptoStream::crypto_negotiated_params() const { |
117 return crypto_negotiated_params_; | 118 return crypto_negotiated_params_; |
118 } | 119 } |
119 | 120 |
120 } // namespace net | 121 } // namespace net |
OLD | NEW |