OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 LOG(LS_INFO) << "HTTPPortAllocator: sending to relay host " << host; | 161 LOG(LS_INFO) << "HTTPPortAllocator: sending to relay host " << host; |
162 if (relay_token_.empty()) { | 162 if (relay_token_.empty()) { |
163 LOG(LS_WARNING) << "No relay auth token found."; | 163 LOG(LS_WARNING) << "No relay auth token found."; |
164 } | 164 } |
165 | 165 |
166 SendSessionRequest(host, rtc::HTTP_SECURE_PORT); | 166 SendSessionRequest(host, rtc::HTTP_SECURE_PORT); |
167 } | 167 } |
168 | 168 |
169 std::string HttpPortAllocatorSessionBase::GetSessionRequestUrl() { | 169 std::string HttpPortAllocatorSessionBase::GetSessionRequestUrl() { |
170 std::string url = std::string(HttpPortAllocator::kCreateSessionURL); | 170 std::string url = std::string(HttpPortAllocator::kCreateSessionURL); |
171 if (allocator()->flags() & PORTALLOCATOR_ENABLE_SHARED_UFRAG) { | 171 ASSERT(!username().empty()); |
172 ASSERT(!username().empty()); | 172 ASSERT(!password().empty()); |
173 ASSERT(!password().empty()); | 173 url = url + "?username=" + rtc::s_url_encode(username()) + |
174 url = url + "?username=" + rtc::s_url_encode(username()) + | 174 "&password=" + rtc::s_url_encode(password()); |
175 "&password=" + rtc::s_url_encode(password()); | |
176 } | |
177 return url; | 175 return url; |
178 } | 176 } |
179 | 177 |
180 void HttpPortAllocatorSessionBase::ReceiveSessionResponse( | 178 void HttpPortAllocatorSessionBase::ReceiveSessionResponse( |
181 const std::string& response) { | 179 const std::string& response) { |
182 | 180 |
183 StringMap map; | 181 StringMap map; |
184 ParseMap(response, map); | 182 ParseMap(response, map); |
185 | 183 |
186 if (!username().empty() && map["username"] != username()) { | 184 if (!username().empty() && map["username"] != username()) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 rtc::MemoryStream* stream = | 315 rtc::MemoryStream* stream = |
318 static_cast<rtc::MemoryStream*>(request->response().document.get()); | 316 static_cast<rtc::MemoryStream*>(request->response().document.get()); |
319 stream->Rewind(); | 317 stream->Rewind(); |
320 size_t length; | 318 size_t length; |
321 stream->GetSize(&length); | 319 stream->GetSize(&length); |
322 std::string resp = std::string(stream->GetBuffer(), length); | 320 std::string resp = std::string(stream->GetBuffer(), length); |
323 ReceiveSessionResponse(resp); | 321 ReceiveSessionResponse(resp); |
324 } | 322 } |
325 | 323 |
326 } // namespace cricket | 324 } // namespace cricket |
OLD | NEW |