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

Unified Diff: webrtc/p2p/client/basicportallocator.cc

Issue 1274013002: Bug 4865: Enable connectivity when the remote peer is on public internet. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 4 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
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 3f5aa0a1ff396cbb512d65166d46c54c598b70b9..90c2619e92695cd0e37c50623d0646aacb0a149a 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -454,12 +454,15 @@ void BasicPortAllocatorSession::OnCandidateReady(
SignalCandidatesReady(this, candidates);
juberti1 2015/08/06 00:35:26 Will we push 0.0.0.0 to the application here? We w
pthatcher1 2015/08/06 01:06:19 I believe candidate_allowed_to_send will be false
guoweis_webrtc 2015/08/06 08:50:07 Correct. It'll be filtered out
}
- // Moving to READY state as we have atleast one candidate from the port.
- // Since this port has atleast one candidate we should forward this port
- // to listners, to allow connections from this port.
- // Also we should make sure that candidate gathered from this port is allowed
- // to send outside.
- if (!data->ready() && candidate_allowed_to_send) {
+ // Moving to READY state as we have at least one candidate from the port or
juberti1 2015/08/06 00:35:26 This comment could be worded better. It's importan
guoweis_webrtc 2015/08/06 08:50:07 Done.
+ // the candidate has the any address. When this port has at least one
+ // candidate we should forward this port to listeners, to allow connections
+ // from this port. Also we should make sure that candidate gathered from this
+ // port is allowed to send outside. When the candidate address is the any
+ // address, we need to move the port to READY such that connectivity is
+ // possible if the remote peer has a routable IP address on public Internet.
pthatcher1 2015/08/06 01:06:19 I think we can re-word this in terms of "we're rea
guoweis_webrtc 2015/08/06 08:50:06 Done.
+ if (!data->ready() && (candidate_allowed_to_send ||
+ (c.address().IsAnyIP() && port->SharedSocket()))) {
pthatcher1 2015/08/06 01:06:19 I think this would be a lot more readable if we br
guoweis_webrtc 2015/08/06 08:50:07 I rephrase it a bit. Send and Receive is not very
data->set_ready();
SignalPortReady(this, port);
}

Powered by Google App Engine
This is Rietveld 408576698