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

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

Issue 1516613002: Only try to pair protocol matching candidates for creating connections. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: merge Created 5 years 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/turnport.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 2012 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2012 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 435 }
436 socket_ = NULL; 436 socket_ = NULL;
437 437
438 PrepareAddress(); 438 PrepareAddress();
439 ++allocate_mismatch_retries_; 439 ++allocate_mismatch_retries_;
440 } 440 }
441 441
442 Connection* TurnPort::CreateConnection(const Candidate& address, 442 Connection* TurnPort::CreateConnection(const Candidate& address,
443 CandidateOrigin origin) { 443 CandidateOrigin origin) {
444 // TURN-UDP can only connect to UDP candidates. 444 // TURN-UDP can only connect to UDP candidates.
445 if (address.protocol() != UDP_PROTOCOL_NAME) { 445 if (!SupportsProtocol(address.protocol())) {
446 return NULL; 446 return NULL;
447 } 447 }
448 448
449 if (!IsCompatibleAddress(address.address())) { 449 if (!IsCompatibleAddress(address.address())) {
450 return NULL; 450 return NULL;
451 } 451 }
452 452
453 if (state_ == STATE_DISCONNECTED) { 453 if (state_ == STATE_DISCONNECTED) {
454 return NULL; 454 return NULL;
455 } 455 }
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 } else { 1483 } else {
1484 state_ = STATE_UNBOUND; 1484 state_ = STATE_UNBOUND;
1485 port_->DestroyConnection(ext_addr_); 1485 port_->DestroyConnection(ext_addr_);
1486 } 1486 }
1487 } 1487 }
1488 void TurnEntry::OnChannelBindTimeout() { 1488 void TurnEntry::OnChannelBindTimeout() {
1489 state_ = STATE_UNBOUND; 1489 state_ = STATE_UNBOUND;
1490 port_->DestroyConnection(ext_addr_); 1490 port_->DestroyConnection(ext_addr_);
1491 } 1491 }
1492 } // namespace cricket 1492 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/turnport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698