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

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
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..e2f8670dd1f36a07d5c7e8bd76bf228afe245c6c 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,8 @@ void P2PPortAllocatorSession::AllocateRelaySession() {
}
std::string url = "https://" + allocator_->config_.relay_server +
- kCreateRelaySessionURL;
+ kCreateRelaySessionURL + "?username=" + username() +
+ "&password=" + password();
Wez 2012/04/13 02:49:49 Are username() and password() URL-escaped, or guar
Sergey Ulanov 2012/04/13 19:50:38 That's a good catch! PortAllocator uses Base64 alp
// Use |relay_username| parameter to identify type of client for the
// relay session.
@@ -235,8 +236,6 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
return;
}
- relay_username_.clear();
- relay_password_.clear();
relay_ip_.Clear();
relay_udp_port_ = 0;
relay_tcp_port_ = 0;
@@ -251,9 +250,15 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
TrimWhitespaceASCII(it->second, TRIM_ALL, &value);
if (key == "username") {
- relay_username_ = value;
+ if (value != username()) {
+ LOG(WARNING) << "When creating relay session received "
+ " user name that was specified in the query";
Wez 2012/04/13 02:49:49 I don't understand this error message. This is th
Sergey Ulanov 2012/04/13 19:50:38 Right. Previously username/password were generated
Wez 2012/04/13 22:26:04 In that case, should we fail this port allocator i
Sergey Ulanov 2012/04/13 22:30:28 Done.
+ }
} else if (key == "password") {
- relay_password_ = value;
+ if (value != password()) {
+ LOG(WARNING) << "When creating relay session received "
+ " user name that was specified in the query";
Wez 2012/04/13 02:49:49 typo: "user name" -> "password"
Sergey Ulanov 2012/04/13 19:50:38 Done.
+ }
} else if (key == "relay.ip") {
relay_ip_.SetIP(value);
if (relay_ip_.ip() == 0) {
@@ -278,7 +283,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;

Powered by Google App Engine
This is Rietveld 408576698