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

Side by Side Diff: webrtc/p2p/base/port.cc

Issue 1868353004: Update prflx candidates' generation when setting ICE credentials. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Re-enable the disabled test condition. Created 4 years, 8 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 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 bool use_candidate = use_candidate_attr(); 1291 bool use_candidate = use_candidate_attr();
1292 LOG_JV(sev, this) << "Sent STUN ping" 1292 LOG_JV(sev, this) << "Sent STUN ping"
1293 << ", id=" << rtc::hex_encode(request->id()) 1293 << ", id=" << rtc::hex_encode(request->id())
1294 << ", use_candidate=" << use_candidate; 1294 << ", use_candidate=" << use_candidate;
1295 } 1295 }
1296 1296
1297 void Connection::HandleRoleConflictFromPeer() { 1297 void Connection::HandleRoleConflictFromPeer() {
1298 port_->SignalRoleConflict(port_); 1298 port_->SignalRoleConflict(port_);
1299 } 1299 }
1300 1300
1301 void Connection::MaybeSetRemoteIceCredentials(const std::string& ice_ufrag, 1301 void Connection::MaybeSetRemoteIceCredentialsAndGeneration(
1302 const std::string& ice_pwd) { 1302 const std::vector<IceParameters>& remote_ice_parameters) {
1303 if (remote_candidate_.username() == ice_ufrag && 1303 int generation = 0;
1304 remote_candidate_.password().empty()) { 1304 for (const IceParameters& params : remote_ice_parameters) {
1305 remote_candidate_.set_password(ice_pwd); 1305 if (remote_candidate_.username() == params.ufrag &&
1306 remote_candidate_.password().empty()) {
1307 remote_candidate_.set_password(params.pwd);
pthatcher1 2016/04/12 18:47:39 Should we also set_generation() here?
Taylor Brandstetter 2016/04/12 21:33:46 I guess it would be a small optimization. Or do we
pthatcher1 2016/04/12 22:39:53 Oh, I see. In the first case, you end up doing th
1308 }
1309 if (remote_candidate_.username() == params.ufrag &&
1310 remote_candidate_.password() == params.pwd) {
1311 remote_candidate_.set_generation(generation);
1312 }
1313 ++generation;
1306 } 1314 }
1307 } 1315 }
1308 1316
1309 void Connection::MaybeUpdatePeerReflexiveCandidate( 1317 void Connection::MaybeUpdatePeerReflexiveCandidate(
1310 const Candidate& new_candidate) { 1318 const Candidate& new_candidate) {
1311 if (remote_candidate_.type() == PRFLX_PORT_TYPE && 1319 if (remote_candidate_.type() == PRFLX_PORT_TYPE &&
1312 new_candidate.type() != PRFLX_PORT_TYPE && 1320 new_candidate.type() != PRFLX_PORT_TYPE &&
1313 remote_candidate_.protocol() == new_candidate.protocol() && 1321 remote_candidate_.protocol() == new_candidate.protocol() &&
1314 remote_candidate_.address() == new_candidate.address() && 1322 remote_candidate_.address() == new_candidate.address() &&
1315 remote_candidate_.username() == new_candidate.username() && 1323 remote_candidate_.username() == new_candidate.username() &&
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 ASSERT(sent < 0); 1448 ASSERT(sent < 0);
1441 error_ = port_->GetError(); 1449 error_ = port_->GetError();
1442 sent_packets_discarded_++; 1450 sent_packets_discarded_++;
1443 } else { 1451 } else {
1444 send_rate_tracker_.AddSamples(sent); 1452 send_rate_tracker_.AddSamples(sent);
1445 } 1453 }
1446 return sent; 1454 return sent;
1447 } 1455 }
1448 1456
1449 } // namespace cricket 1457 } // namespace cricket
OLDNEW
« webrtc/p2p/base/p2ptransportchannel.cc ('K') | « webrtc/p2p/base/port.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698