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

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: 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
« webrtc/p2p/base/port_unittest.cc ('K') | « 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 socket_ = NULL; 429 socket_ = NULL;
430 430
431 PrepareAddress(); 431 PrepareAddress();
432 ++allocate_mismatch_retries_; 432 ++allocate_mismatch_retries_;
433 } 433 }
434 434
435 Connection* TurnPort::CreateConnection(const Candidate& address, 435 Connection* TurnPort::CreateConnection(const Candidate& address,
436 CandidateOrigin origin) { 436 CandidateOrigin origin) {
437 // TURN-UDP can only connect to UDP candidates. 437 // TURN-UDP can only connect to UDP candidates.
438 if (address.protocol() != UDP_PROTOCOL_NAME) { 438 if (!ProtocolMatch(address.protocol())) {
439 return NULL; 439 return NULL;
440 } 440 }
441 441
442 if (!IsCompatibleAddress(address.address())) { 442 if (!IsCompatibleAddress(address.address())) {
443 return NULL; 443 return NULL;
444 } 444 }
445 445
446 if (state_ == STATE_DISCONNECTED) { 446 if (state_ == STATE_DISCONNECTED) {
447 return NULL; 447 return NULL;
448 } 448 }
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 1429 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3
1430 if (code == STUN_ERROR_STALE_NONCE) { 1430 if (code == STUN_ERROR_STALE_NONCE) {
1431 if (port_->UpdateNonce(response)) { 1431 if (port_->UpdateNonce(response)) {
1432 // Send channel bind request with fresh nonce. 1432 // Send channel bind request with fresh nonce.
1433 SendChannelBindRequest(0); 1433 SendChannelBindRequest(0);
1434 } 1434 }
1435 } 1435 }
1436 } 1436 }
1437 1437
1438 } // namespace cricket 1438 } // namespace cricket
OLDNEW
« webrtc/p2p/base/port_unittest.cc ('K') | « webrtc/p2p/base/turnport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698