Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 } | 277 } |
| 278 username.assign(rtc::s_url_decode(tokens[0])); | 278 username.assign(rtc::s_url_decode(tokens[0])); |
| 279 hoststring = tokens[1]; | 279 hoststring = tokens[1]; |
| 280 } else { | 280 } else { |
| 281 hoststring = tokens[0]; | 281 hoststring = tokens[0]; |
| 282 } | 282 } |
| 283 | 283 |
| 284 int port = kDefaultStunPort; | 284 int port = kDefaultStunPort; |
| 285 if (service_type == TURNS) { | 285 if (service_type == TURNS) { |
| 286 port = kDefaultStunTlsPort; | 286 port = kDefaultStunTlsPort; |
| 287 turn_transport_type = cricket::PROTO_TCP; | 287 turn_transport_type = cricket::PROTO_TLS; |
| 288 } | 288 } |
| 289 | 289 |
| 290 std::string address; | 290 std::string address; |
| 291 if (!ParseHostnameAndPortFromString(hoststring, &address, &port)) { | 291 if (!ParseHostnameAndPortFromString(hoststring, &address, &port)) { |
| 292 LOG(WARNING) << "Invalid hostname format: " << uri_without_transport; | 292 LOG(WARNING) << "Invalid hostname format: " << uri_without_transport; |
| 293 return false; | 293 return false; |
| 294 } | 294 } |
| 295 | 295 |
| 296 if (port <= 0 || port > 0xffff) { | 296 if (port <= 0 || port > 0xffff) { |
| 297 LOG(WARNING) << "Invalid port: " << port; | 297 LOG(WARNING) << "Invalid port: " << port; |
| 298 return false; | 298 return false; |
| 299 } | 299 } |
| 300 | 300 |
| 301 switch (service_type) { | 301 switch (service_type) { |
| 302 case STUN: | 302 case STUN: |
| 303 case STUNS: | 303 case STUNS: |
| 304 stun_servers->insert(rtc::SocketAddress(address, port)); | 304 stun_servers->insert(rtc::SocketAddress(address, port)); |
| 305 break; | 305 break; |
| 306 case TURN: | 306 case TURN: |
| 307 case TURNS: { | 307 case TURNS: { |
| 308 bool secure = (service_type == TURNS); | 308 cricket::ProtocolFlags flags = cricket::PROTO_FLAG_NONE; |
| 309 if (server.tls_certificate_policy == | |
| 310 PeerConnectionInterface::kTlsCertPolicyInsecureNoCheck) { | |
| 311 flags = (cricket::ProtocolFlags)( | |
| 312 flags | cricket::PROTO_FLAG_INSECURE_CERT_CHECK); | |
| 313 } | |
| 309 turn_servers->push_back( | 314 turn_servers->push_back( |
| 310 cricket::RelayServerConfig(address, port, username, server.password, | 315 cricket::RelayServerConfig(address, port, username, server.password, |
| 311 turn_transport_type, secure)); | 316 turn_transport_type, flags)); |
|
pthatcher1
2016/12/07 21:29:35
Attaching flags onto relay servers feels like the
Taylor Brandstetter
2016/12/08 01:36:40
I disagree. "Verify certificate or not?" is fundam
pthatcher1
2016/12/08 02:36:13
Perhaps I misunderstood the use case we're trying
Taylor Brandstetter
2016/12/08 18:51:39
Maybe there's no obvious use case right now. But:
hnsl1
2016/12/12 16:08:13
Imagine a scenario where you have a RTCConfigurati
pthatcher1
2016/12/12 23:12:29
OK, I think I understand the use case. Let's talk
| |
| 312 break; | 317 break; |
| 313 } | 318 } |
| 314 case INVALID: | 319 case INVALID: |
| 315 default: | 320 default: |
| 316 LOG(WARNING) << "Configuration not supported: " << url; | 321 LOG(WARNING) << "Configuration not supported: " << url; |
| 317 return false; | 322 return false; |
| 318 } | 323 } |
| 319 return true; | 324 return true; |
| 320 } | 325 } |
| 321 | 326 |
| (...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2367 | 2372 |
| 2368 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2373 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
| 2369 int64_t max_size_bytes) { | 2374 int64_t max_size_bytes) { |
| 2370 return event_log_->StartLogging(file, max_size_bytes); | 2375 return event_log_->StartLogging(file, max_size_bytes); |
| 2371 } | 2376 } |
| 2372 | 2377 |
| 2373 void PeerConnection::StopRtcEventLog_w() { | 2378 void PeerConnection::StopRtcEventLog_w() { |
| 2374 event_log_->StopLogging(); | 2379 event_log_->StopLogging(); |
| 2375 } | 2380 } |
| 2376 } // namespace webrtc | 2381 } // namespace webrtc |
| OLD | NEW |