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

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.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
« no previous file with comments | « no previous file | webrtc/p2p/base/port_unittest.cc » ('j') | webrtc/p2p/base/port_unittest.cc » ('J')
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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 RememberRemoteCandidate(new_remote_candidate, origin_port); 731 RememberRemoteCandidate(new_remote_candidate, origin_port);
732 732
733 return created; 733 return created;
734 } 734 }
735 735
736 // Setup a connection object for the local and remote candidate combination. 736 // Setup a connection object for the local and remote candidate combination.
737 // And then listen to connection object for changes. 737 // And then listen to connection object for changes.
738 bool P2PTransportChannel::CreateConnection(PortInterface* port, 738 bool P2PTransportChannel::CreateConnection(PortInterface* port,
739 const Candidate& remote_candidate, 739 const Candidate& remote_candidate,
740 PortInterface* origin_port) { 740 PortInterface* origin_port) {
741 if (!port->ProtocolMatch(remote_candidate.protocol())) {
742 return false;
743 }
741 // Look for an existing connection with this remote address. If one is not 744 // Look for an existing connection with this remote address. If one is not
742 // found, then we can create a new connection for this address. 745 // found, then we can create a new connection for this address.
743 Connection* connection = port->GetConnection(remote_candidate.address()); 746 Connection* connection = port->GetConnection(remote_candidate.address());
pthatcher1 2015/12/11 02:05:36 So, if we get two TURN candidates, one for TCP and
honghaiz3 2015/12/11 18:36:31 TurnPort should only generate UDP candidate. GTurn
pthatcher1 2015/12/12 03:05:30 Oh, duh. Good point.
744 if (connection != NULL) { 747 if (connection != NULL) {
745 connection->MaybeUpdatePeerReflexiveCandidate(remote_candidate); 748 connection->MaybeUpdatePeerReflexiveCandidate(remote_candidate);
746 749
747 // It is not legal to try to change any of the parameters of an existing 750 // It is not legal to try to change any of the parameters of an existing
748 // connection; however, the other side can send a duplicate candidate. 751 // connection; however, the other side can send a duplicate candidate.
749 if (!remote_candidate.IsEquivalent(connection->remote_candidate())) { 752 if (!remote_candidate.IsEquivalent(connection->remote_candidate())) {
750 LOG(INFO) << "Attempt to change a remote candidate." 753 LOG(INFO) << "Attempt to change a remote candidate."
751 << " Existing remote candidate: " 754 << " Existing remote candidate: "
752 << connection->remote_candidate().ToString() 755 << connection->remote_candidate().ToString()
753 << "New remote candidate: " 756 << "New remote candidate: "
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 SignalSentPacket(this, sent_packet); 1397 SignalSentPacket(this, sent_packet);
1395 } 1398 }
1396 1399
1397 void P2PTransportChannel::OnReadyToSend(Connection* connection) { 1400 void P2PTransportChannel::OnReadyToSend(Connection* connection) {
1398 if (connection == best_connection_ && writable()) { 1401 if (connection == best_connection_ && writable()) {
1399 SignalReadyToSend(this); 1402 SignalReadyToSend(this);
1400 } 1403 }
1401 } 1404 }
1402 1405
1403 } // namespace cricket 1406 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/base/port_unittest.cc » ('j') | webrtc/p2p/base/port_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698