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

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: Only need to pass in the last ICE params and the generation. 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
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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::string& ice_ufrag,
1303 const std::string& ice_pwd,
1304 int generation) {
1303 if (remote_candidate_.username() == ice_ufrag && 1305 if (remote_candidate_.username() == ice_ufrag &&
1304 remote_candidate_.password().empty()) { 1306 remote_candidate_.password().empty()) {
1305 remote_candidate_.set_password(ice_pwd); 1307 remote_candidate_.set_password(ice_pwd);
1306 } 1308 }
1309 // TODO(deadbeef): A value of '0' for the generation is used for both
1310 // generation 0 and "generation unknown". It should be changed to an
1311 // rtc::Optional to fix this.
1312 if (remote_candidate_.username() == ice_ufrag &&
1313 remote_candidate_.password() == ice_pwd &&
1314 remote_candidate_.generation() == 0) {
1315 remote_candidate_.set_generation(generation);
1316 }
1307 } 1317 }
1308 1318
1309 void Connection::MaybeUpdatePeerReflexiveCandidate( 1319 void Connection::MaybeUpdatePeerReflexiveCandidate(
1310 const Candidate& new_candidate) { 1320 const Candidate& new_candidate) {
1311 if (remote_candidate_.type() == PRFLX_PORT_TYPE && 1321 if (remote_candidate_.type() == PRFLX_PORT_TYPE &&
1312 new_candidate.type() != PRFLX_PORT_TYPE && 1322 new_candidate.type() != PRFLX_PORT_TYPE &&
1313 remote_candidate_.protocol() == new_candidate.protocol() && 1323 remote_candidate_.protocol() == new_candidate.protocol() &&
1314 remote_candidate_.address() == new_candidate.address() && 1324 remote_candidate_.address() == new_candidate.address() &&
1315 remote_candidate_.username() == new_candidate.username() && 1325 remote_candidate_.username() == new_candidate.username() &&
1316 remote_candidate_.password() == new_candidate.password() && 1326 remote_candidate_.password() == new_candidate.password() &&
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 ASSERT(sent < 0); 1450 ASSERT(sent < 0);
1441 error_ = port_->GetError(); 1451 error_ = port_->GetError();
1442 sent_packets_discarded_++; 1452 sent_packets_discarded_++;
1443 } else { 1453 } else {
1444 send_rate_tracker_.AddSamples(sent); 1454 send_rate_tracker_.AddSamples(sent);
1445 } 1455 }
1446 return sent; 1456 return sent;
1447 } 1457 }
1448 1458
1449 } // namespace cricket 1459 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698