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

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

Issue 1619213003: Include relay protocol type when computing the turn candidate foundation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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/port_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port.cc
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc
index 9dd5c83fed77a53d38fea670fb92d6dc7c141012..7993cc02bc082819340ca1e80b974dd91716f995 100644
--- a/webrtc/p2p/base/port.cc
+++ b/webrtc/p2p/base/port.cc
@@ -120,12 +120,12 @@ const char TCPTYPE_SIMOPEN_STR[] = "so";
// then the foundation will be different. Two candidate pairs with
// the same foundation pairs are likely to have similar network
// characteristics. Foundations are used in the frozen algorithm.
-static std::string ComputeFoundation(
- const std::string& type,
- const std::string& protocol,
- const rtc::SocketAddress& base_address) {
+static std::string ComputeFoundation(const std::string& type,
+ const std::string& protocol,
+ const std::string& relay_protocol,
+ const rtc::SocketAddress& base_address) {
std::ostringstream ost;
- ost << type << base_address.ipaddr().ToString() << protocol;
+ ost << type << base_address.ipaddr().ToString() << protocol << relay_protocol;
return rtc::ToString<uint32_t>(rtc::ComputeCrc32(ost.str()));
}
@@ -252,7 +252,8 @@ void Port::AddAddress(const rtc::SocketAddress& address,
c.set_network_type(network_->type());
c.set_generation(generation_);
c.set_related_address(related_address);
- c.set_foundation(ComputeFoundation(type, protocol, base_address));
+ c.set_foundation(
+ ComputeFoundation(type, protocol, relay_protocol, base_address));
candidates_.push_back(c);
SignalCandidateReady(this, c);
@@ -1389,9 +1390,9 @@ void Connection::MaybeAddPrflxCandidate(ConnectionRequest* request,
new_local_candidate.set_network_name(local_candidate().network_name());
new_local_candidate.set_network_type(local_candidate().network_type());
new_local_candidate.set_related_address(local_candidate().address());
- new_local_candidate.set_foundation(
- ComputeFoundation(PRFLX_PORT_TYPE, local_candidate().protocol(),
- local_candidate().address()));
+ new_local_candidate.set_foundation(ComputeFoundation(
+ PRFLX_PORT_TYPE, local_candidate().protocol(),
+ local_candidate().relay_protocol(), local_candidate().address()));
// Change the local candidate of this Connection to the new prflx candidate.
local_candidate_index_ = port_->AddPrflxCandidate(new_local_candidate);
« no previous file with comments | « no previous file | webrtc/p2p/base/port_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698