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/crypto/crypto_framer.h" | 5 #include "net/quic/crypto/crypto_framer.h" |
6 | 6 |
7 #include "net/quic/quic_data_reader.h" | 7 #include "net/quic/quic_data_reader.h" |
8 #include "net/quic/quic_data_writer.h" | 8 #include "net/quic/quic_data_writer.h" |
9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 97 } |
98 state_ = STATE_READING_VALUES; | 98 state_ = STATE_READING_VALUES; |
99 } | 99 } |
100 case STATE_READING_VALUES: | 100 case STATE_READING_VALUES: |
101 if (reader.BytesRemaining() < values_len_) { | 101 if (reader.BytesRemaining() < values_len_) { |
102 break; | 102 break; |
103 } | 103 } |
104 for (int i = 0; i < num_entries_; ++i) { | 104 for (int i = 0; i < num_entries_; ++i) { |
105 StringPiece value; | 105 StringPiece value; |
106 reader.ReadStringPiece(&value, tag_length_map_[tags_[i]]); | 106 reader.ReadStringPiece(&value, tag_length_map_[tags_[i]]); |
107 tag_value_map_[tags_[i]] = value; | 107 tag_value_map_[tags_[i]] = value.as_string(); |
108 } | 108 } |
109 CryptoHandshakeMessage message; | 109 CryptoHandshakeMessage message; |
110 message.tag = message_tag_; | 110 message.tag = message_tag_; |
111 message.tag_value_map.swap(tag_value_map_); | 111 message.tag_value_map.swap(tag_value_map_); |
112 visitor_->OnHandshakeMessage(message); | 112 visitor_->OnHandshakeMessage(message); |
113 Clear(); | 113 Clear(); |
114 state_ = STATE_READING_TAG; | 114 state_ = STATE_READING_TAG; |
115 break; | 115 break; |
116 } | 116 } |
117 // Save any remaining data. | 117 // Save any remaining data. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 void CryptoFramer::Clear() { | 183 void CryptoFramer::Clear() { |
184 tag_value_map_.clear(); | 184 tag_value_map_.clear(); |
185 tag_length_map_.clear(); | 185 tag_length_map_.clear(); |
186 tags_.clear(); | 186 tags_.clear(); |
187 error_ = QUIC_NO_ERROR; | 187 error_ = QUIC_NO_ERROR; |
188 state_ = STATE_READING_TAG; | 188 state_ = STATE_READING_TAG; |
189 } | 189 } |
190 | 190 |
191 } // namespace net | 191 } // namespace net |
OLD | NEW |