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/crypto/crypto_framer.h" | 5 #include "net/quic/core/crypto/crypto_framer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/quic/core/crypto/crypto_protocol.h" | 10 #include "net/quic/core/crypto/crypto_protocol.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 tag, static_cast<size_t>(end_offset - last_end_offset))); | 253 tag, static_cast<size_t>(end_offset - last_end_offset))); |
254 last_end_offset = end_offset; | 254 last_end_offset = end_offset; |
255 } | 255 } |
256 values_len_ = last_end_offset; | 256 values_len_ = last_end_offset; |
257 state_ = STATE_READING_VALUES; | 257 state_ = STATE_READING_VALUES; |
258 } | 258 } |
259 case STATE_READING_VALUES: | 259 case STATE_READING_VALUES: |
260 if (reader.BytesRemaining() < values_len_) { | 260 if (reader.BytesRemaining() < values_len_) { |
261 break; | 261 break; |
262 } | 262 } |
263 for (const pair<QuicTag, size_t>& item : tags_and_lengths_) { | 263 for (const std::pair<QuicTag, size_t>& item : tags_and_lengths_) { |
264 StringPiece value; | 264 StringPiece value; |
265 reader.ReadStringPiece(&value, item.second); | 265 reader.ReadStringPiece(&value, item.second); |
266 message_.SetStringPiece(item.first, value); | 266 message_.SetStringPiece(item.first, value); |
267 } | 267 } |
268 visitor_->OnHandshakeMessage(message_); | 268 visitor_->OnHandshakeMessage(message_); |
269 Clear(); | 269 Clear(); |
270 state_ = STATE_READING_TAG; | 270 state_ = STATE_READING_TAG; |
271 break; | 271 break; |
272 } | 272 } |
273 // Save any remaining data. | 273 // Save any remaining data. |
(...skipping 11 matching lines...) Expand all Loading... |
285 } | 285 } |
286 *end_offset += pad_length; | 286 *end_offset += pad_length; |
287 if (!writer->WriteUInt32(*end_offset)) { | 287 if (!writer->WriteUInt32(*end_offset)) { |
288 DCHECK(false) << "Failed to write end offset."; | 288 DCHECK(false) << "Failed to write end offset."; |
289 return false; | 289 return false; |
290 } | 290 } |
291 return true; | 291 return true; |
292 } | 292 } |
293 | 293 |
294 } // namespace net | 294 } // namespace net |
OLD | NEW |