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

Side by Side Diff: net/quic/core/quic_config.cc

Issue 2907743003: Change CryptoHandshakeMessage::GetTaglist to tag a QuicTagVector* (Closed)
Patch Set: fix QuicConfig Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_config.h" 5 #include "net/quic/core/quic_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "net/quic/core/crypto/crypto_handshake_message.h" 9 #include "net/quic/core/crypto/crypto_handshake_message.h"
10 #include "net/quic/core/crypto/crypto_protocol.h" 10 #include "net/quic/core/crypto/crypto_protocol.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (has_send_values_) { 225 if (has_send_values_) {
226 out->SetVector(tag_, send_values_); 226 out->SetVector(tag_, send_values_);
227 } 227 }
228 } 228 }
229 229
230 QuicErrorCode QuicFixedTagVector::ProcessPeerHello( 230 QuicErrorCode QuicFixedTagVector::ProcessPeerHello(
231 const CryptoHandshakeMessage& peer_hello, 231 const CryptoHandshakeMessage& peer_hello,
232 HelloType hello_type, 232 HelloType hello_type,
233 string* error_details) { 233 string* error_details) {
234 DCHECK(error_details != nullptr); 234 DCHECK(error_details != nullptr);
235 const QuicTag* received_tags; 235 QuicTagVector values;
236 size_t received_tags_length; 236 QuicErrorCode error = peer_hello.GetTaglist(tag_, &values);
237 QuicErrorCode error =
238 peer_hello.GetTaglist(tag_, &received_tags, &received_tags_length);
239 switch (error) { 237 switch (error) {
240 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND: 238 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
241 if (presence_ == PRESENCE_OPTIONAL) { 239 if (presence_ == PRESENCE_OPTIONAL) {
242 return QUIC_NO_ERROR; 240 return QUIC_NO_ERROR;
243 } 241 }
244 *error_details = "Missing " + QuicTagToString(tag_); 242 *error_details = "Missing " + QuicTagToString(tag_);
245 break; 243 break;
246 case QUIC_NO_ERROR: 244 case QUIC_NO_ERROR:
247 QUIC_DVLOG(1) << "Received Connection Option tags from receiver."; 245 QUIC_DVLOG(1) << "Received Connection Option tags from receiver.";
248 has_receive_values_ = true; 246 has_receive_values_ = true;
249 for (size_t i = 0; i < received_tags_length; ++i) { 247 receive_values_.insert(receive_values_.end(), values.begin(),
250 receive_values_.push_back(received_tags[i]); 248 values.end());
251 }
252 break; 249 break;
253 default: 250 default:
254 *error_details = "Bad " + QuicTagToString(tag_); 251 *error_details = "Bad " + QuicTagToString(tag_);
255 break; 252 break;
256 } 253 }
257 return error; 254 return error;
258 } 255 }
259 256
260 QuicFixedSocketAddress::QuicFixedSocketAddress(QuicTag tag, 257 QuicFixedSocketAddress::QuicFixedSocketAddress(QuicTag tag,
261 QuicConfigPresence presence) 258 QuicConfigPresence presence)
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 error_details); 680 error_details);
684 } 681 }
685 if (error == QUIC_NO_ERROR) { 682 if (error == QUIC_NO_ERROR) {
686 error = support_max_header_list_size_.ProcessPeerHello( 683 error = support_max_header_list_size_.ProcessPeerHello(
687 peer_hello, hello_type, error_details); 684 peer_hello, hello_type, error_details);
688 } 685 }
689 return error; 686 return error;
690 } 687 }
691 688
692 } // namespace net 689 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698