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

Unified Diff: content/renderer/p2p/port_allocator.cc

Issue 10069046: Libjingle roll 129:132. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « content/renderer/p2p/port_allocator.h ('k') | third_party/libjingle/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/port_allocator.cc
diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc
index b58dea28838a68901fba923ffce7fc4769cd8695..b22a88bb2e9fa401b1444d91e46267fc5e6bb79e 100644
--- a/content/renderer/p2p/port_allocator.cc
+++ b/content/renderer/p2p/port_allocator.cc
@@ -126,7 +126,7 @@ void P2PPortAllocatorSession::GetPortConfigurations() {
// Add an empty configuration synchronously, so a local connection
// can be started immediately.
ConfigReady(new cricket::PortConfiguration(
- talk_base::SocketAddress(), "", "", ""));
+ talk_base::SocketAddress(), username(), password(), ""));
ResolveStunServerAddress();
AllocateRelaySession();
@@ -193,7 +193,9 @@ void P2PPortAllocatorSession::AllocateRelaySession() {
}
std::string url = "https://" + allocator_->config_.relay_server +
- kCreateRelaySessionURL;
+ kCreateRelaySessionURL +
+ "?username=" + net::EscapeUrlEncodedData(username(), true) +
+ "&password=" + net::EscapeUrlEncodedData(password(), true);
// Use |relay_username| parameter to identify type of client for the
// relay session.
@@ -203,7 +205,7 @@ void P2PPortAllocatorSession::AllocateRelaySession() {
// is currently used for Chromoting only. This code should be removed
// once Chromoting stops using Transport API and the API is removed.
if (!allocator_->config_.relay_username.empty()) {
- url += "?sn=" +
+ url += "&sn=" +
net::EscapeUrlEncodedData(allocator_->config_.relay_username, true);
}
@@ -235,8 +237,6 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
return;
}
- relay_username_.clear();
- relay_password_.clear();
relay_ip_.Clear();
relay_udp_port_ = 0;
relay_tcp_port_ = 0;
@@ -251,9 +251,17 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
TrimWhitespaceASCII(it->second, TRIM_ALL, &value);
if (key == "username") {
- relay_username_ = value;
+ if (value != username()) {
+ LOG(ERROR) << "When creating relay session received user name "
+ " that was different from the value specified in the query.";
+ return;
+ }
} else if (key == "password") {
- relay_password_ = value;
+ if (value != password()) {
+ LOG(ERROR) << "When creating relay session received password "
+ "that was different from the value specified in the query.";
+ return;
+ }
} else if (key == "relay.ip") {
relay_ip_.SetIP(value);
if (relay_ip_.ip() == 0) {
@@ -278,7 +286,7 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
void P2PPortAllocatorSession::AddConfig() {
cricket::PortConfiguration* config =
new cricket::PortConfiguration(stun_server_address_,
- relay_username_, relay_password_, "");
+ username(), password(), "");
if (relay_ip_.ip() != 0) {
cricket::PortConfiguration::PortList ports;
« no previous file with comments | « content/renderer/p2p/port_allocator.h ('k') | third_party/libjingle/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698