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

Unified Diff: webrtc/p2p/base/turnport.cc

Issue 2083803002: Fix IPv6 support issue. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge branch 'master' into fix_ipv6_support Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/turnport.cc
diff --git a/webrtc/p2p/base/turnport.cc b/webrtc/p2p/base/turnport.cc
index 40368110e398a1edabfa3a5397ca2d8ad38b333d..824a25e644ba1c48eeb49f022933630f68059ee3 100644
--- a/webrtc/p2p/base/turnport.cc
+++ b/webrtc/p2p/base/turnport.cc
@@ -291,7 +291,7 @@ void TurnPort::PrepareAddress() {
if (!IsCompatibleAddress(server_address_.address)) {
LOG(LS_ERROR) << "IP address family does not match: "
<< "server: " << server_address_.address.family()
- << "local: " << ip().family();
+ << " local: " << ip().family();
OnAllocateError();
return;
}
@@ -438,14 +438,10 @@ void TurnPort::OnAllocateMismatch() {
++allocate_mismatch_retries_;
}
-Connection* TurnPort::CreateConnection(const Candidate& address,
+Connection* TurnPort::CreateConnection(const Candidate& remote_candidate,
CandidateOrigin origin) {
// TURN-UDP can only connect to UDP candidates.
- if (!SupportsProtocol(address.protocol())) {
- return NULL;
- }
-
- if (!IsCompatibleAddress(address.address())) {
+ if (!SupportsProtocol(remote_candidate.protocol())) {
return NULL;
}
@@ -453,15 +449,19 @@ Connection* TurnPort::CreateConnection(const Candidate& address,
return NULL;
}
- // Create an entry, if needed, so we can get our permissions set up correctly.
- CreateOrRefreshEntry(address.address());
-
// A TURN port will have two candiates, STUN and TURN. STUN may not
juberti 2016/06/23 14:51:18 Is this still the case? I was under the impression
Taylor Brandstetter 2016/06/23 17:09:53 You may be right. I think even if using a TURN ser
honghaiz3 2016/06/23 17:17:04 Agree. I think the TURN port is not collecting STU
// present in all cases. If present stun candidate will be added first
// and TURN candidate later.
for (size_t index = 0; index < Candidates().size(); ++index) {
- if (Candidates()[index].type() == RELAY_PORT_TYPE) {
- ProxyConnection* conn = new ProxyConnection(this, index, address);
+ const Candidate& local_candidate = Candidates()[index];
+ if (local_candidate.type() == RELAY_PORT_TYPE &&
+ local_candidate.address().family() ==
+ remote_candidate.address().family()) {
+ // Create an entry, if needed, so we can get our permissions set up
+ // correctly.
+ CreateOrRefreshEntry(remote_candidate.address());
+ ProxyConnection* conn =
+ new ProxyConnection(this, index, remote_candidate);
AddOrReplaceConnection(conn);
return conn;
}
« no previous file with comments | « no previous file | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698