Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: net/quic/quic_framer.cc

Issue 1983183002: Landing Recent QUIC changes until 5/14/2016 02:25:25 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "first try to fix link error for win_clang build" Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_flow_controller_test.cc ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_framer.h" 5 #include "net/quic/quic_framer.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 472 }
473 const QuicData& reset_serialized = reset.GetSerialized(); 473 const QuicData& reset_serialized = reset.GetSerialized();
474 474
475 size_t len = 475 size_t len =
476 kPublicFlagsSize + PACKET_8BYTE_CONNECTION_ID + reset_serialized.length(); 476 kPublicFlagsSize + PACKET_8BYTE_CONNECTION_ID + reset_serialized.length();
477 std::unique_ptr<char[]> buffer(new char[len]); 477 std::unique_ptr<char[]> buffer(new char[len]);
478 QuicDataWriter writer(len, buffer.get()); 478 QuicDataWriter writer(len, buffer.get());
479 479
480 uint8_t flags = static_cast<uint8_t>(PACKET_PUBLIC_FLAGS_RST | 480 uint8_t flags = static_cast<uint8_t>(PACKET_PUBLIC_FLAGS_RST |
481 PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID); 481 PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID);
482 if (FLAGS_quic_use_old_public_reset_packets) {
483 // TODO(rch): Remove this QUIC_VERSION_32 is retired.
484 flags |= static_cast<uint8_t>(PACKET_PUBLIC_FLAGS_8BYTE_CONNECTION_ID_OLD);
485 }
482 if (!writer.WriteUInt8(flags)) { 486 if (!writer.WriteUInt8(flags)) {
483 return nullptr; 487 return nullptr;
484 } 488 }
485 489
486 if (!writer.WriteUInt64(packet.public_header.connection_id)) { 490 if (!writer.WriteUInt64(packet.public_header.connection_id)) {
487 return nullptr; 491 return nullptr;
488 } 492 }
489 493
490 if (!writer.WriteBytes(reset_serialized.data(), reset_serialized.length())) { 494 if (!writer.WriteBytes(reset_serialized.data(), reset_serialized.length())) {
491 return nullptr; 495 return nullptr;
(...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 2569
2566 bool QuicFramer::RaiseError(QuicErrorCode error) { 2570 bool QuicFramer::RaiseError(QuicErrorCode error) {
2567 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) 2571 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error)
2568 << " detail: " << detailed_error_; 2572 << " detail: " << detailed_error_;
2569 set_error(error); 2573 set_error(error);
2570 visitor_->OnError(this); 2574 visitor_->OnError(this);
2571 return false; 2575 return false;
2572 } 2576 }
2573 2577
2574 } // namespace net 2578 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flow_controller_test.cc ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698