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

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

Issue 2102733002: Deprecate FLAGS_quic_disallow_multi_packet_chlo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@125563155
Patch Set: Created 4 years, 5 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_flags.cc ('k') | net/quic/quic_packet_creator_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_packet_creator.h" 5 #include "net/quic/quic_packet_creator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 size_t iov_offset, 127 size_t iov_offset,
128 QuicStreamOffset offset, 128 QuicStreamOffset offset,
129 bool fin, 129 bool fin,
130 bool needs_full_padding, 130 bool needs_full_padding,
131 QuicFrame* frame) { 131 QuicFrame* frame) {
132 if (!HasRoomForStreamFrame(id, offset)) { 132 if (!HasRoomForStreamFrame(id, offset)) {
133 return false; 133 return false;
134 } 134 }
135 CreateStreamFrame(id, iov, iov_offset, offset, fin, frame); 135 CreateStreamFrame(id, iov, iov_offset, offset, fin, frame);
136 // Explicitly disallow multi-packet CHLOs. 136 // Explicitly disallow multi-packet CHLOs.
137 if (FLAGS_quic_disallow_multi_packet_chlo && id == kCryptoStreamId && 137 if (id == kCryptoStreamId &&
138 frame->stream_frame->data_length >= sizeof(kCHLO) && 138 frame->stream_frame->data_length >= sizeof(kCHLO) &&
139 strncmp(frame->stream_frame->data_buffer, 139 strncmp(frame->stream_frame->data_buffer,
140 reinterpret_cast<const char*>(&kCHLO), sizeof(kCHLO)) == 0) { 140 reinterpret_cast<const char*>(&kCHLO), sizeof(kCHLO)) == 0) {
141 DCHECK_EQ(static_cast<size_t>(0), iov_offset); 141 DCHECK_EQ(static_cast<size_t>(0), iov_offset);
142 if (frame->stream_frame->data_length < iov.iov->iov_len) { 142 if (frame->stream_frame->data_length < iov.iov->iov_len) {
143 const string error_details = "Client hello won't fit in a single packet."; 143 const string error_details = "Client hello won't fit in a single packet.";
144 QUIC_BUG << error_details << " Constructed stream frame length: " 144 QUIC_BUG << error_details << " Constructed stream frame length: "
145 << frame->stream_frame->data_length 145 << frame->stream_frame->data_length
146 << " CHLO length: " << iov.iov->iov_len; 146 << " CHLO length: " << iov.iov->iov_len;
147 delegate_->OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, error_details, 147 delegate_->OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, error_details,
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 if (bit_mask_ == 0) { 687 if (bit_mask_ == 0) {
688 bit_bucket_ = random_->RandUint64(); 688 bit_bucket_ = random_->RandUint64();
689 bit_mask_ = 1; 689 bit_mask_ = 1;
690 } 690 }
691 bool result = ((bit_bucket_ & bit_mask_) != 0); 691 bool result = ((bit_bucket_ & bit_mask_) != 0);
692 bit_mask_ <<= 1; 692 bit_mask_ <<= 1;
693 return result; 693 return result;
694 } 694 }
695 695
696 } // namespace net 696 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698