| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 if (server_address_.proto == PROTO_UDP && !SharedSocket()) { | 322 if (server_address_.proto == PROTO_UDP && !SharedSocket()) { |
| 323 socket_ = socket_factory()->CreateUdpSocket( | 323 socket_ = socket_factory()->CreateUdpSocket( |
| 324 rtc::SocketAddress(ip(), 0), min_port(), max_port()); | 324 rtc::SocketAddress(ip(), 0), min_port(), max_port()); |
| 325 } else if (server_address_.proto == PROTO_TCP || | 325 } else if (server_address_.proto == PROTO_TCP || |
| 326 server_address_.proto == PROTO_TLS) { | 326 server_address_.proto == PROTO_TLS) { |
| 327 ASSERT(!SharedSocket()); | 327 ASSERT(!SharedSocket()); |
| 328 int opts = rtc::PacketSocketFactory::OPT_STUN; | 328 int opts = rtc::PacketSocketFactory::OPT_STUN; |
| 329 | 329 |
| 330 // Apply server address TLS and insecure bits to options. | 330 // Apply server address TLS and insecure bits to options. |
| 331 if (server_address_.proto == PROTO_TLS) { | 331 if (server_address_.proto == PROTO_TLS) { |
| 332 if (tls_cert_policy_ == | 332 opts |= rtc::PacketSocketFactory::OPT_TLS; |
| 333 TlsCertPolicy::TLS_CERT_POLICY_INSECURE_NO_CHECK) { | |
| 334 opts |= rtc::PacketSocketFactory::OPT_TLS_INSECURE; | |
| 335 } else { | |
| 336 opts |= rtc::PacketSocketFactory::OPT_TLS; | |
| 337 } | |
| 338 } | 333 } |
| 339 | |
| 340 socket_ = socket_factory()->CreateClientTcpSocket( | 334 socket_ = socket_factory()->CreateClientTcpSocket( |
| 341 rtc::SocketAddress(ip(), 0), server_address_.address, | 335 rtc::SocketAddress(ip(), 0), server_address_.address, |
| 342 proxy(), user_agent(), opts); | 336 proxy(), user_agent(), opts); |
| 343 } | 337 } |
| 344 | 338 |
| 345 if (!socket_) { | 339 if (!socket_) { |
| 346 error_ = SOCKET_ERROR; | 340 error_ = SOCKET_ERROR; |
| 347 return false; | 341 return false; |
| 348 } | 342 } |
| 349 | 343 |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 } else { | 1543 } else { |
| 1550 state_ = STATE_UNBOUND; | 1544 state_ = STATE_UNBOUND; |
| 1551 port_->FailAndPruneConnection(ext_addr_); | 1545 port_->FailAndPruneConnection(ext_addr_); |
| 1552 } | 1546 } |
| 1553 } | 1547 } |
| 1554 void TurnEntry::OnChannelBindTimeout() { | 1548 void TurnEntry::OnChannelBindTimeout() { |
| 1555 state_ = STATE_UNBOUND; | 1549 state_ = STATE_UNBOUND; |
| 1556 port_->FailAndPruneConnection(ext_addr_); | 1550 port_->FailAndPruneConnection(ext_addr_); |
| 1557 } | 1551 } |
| 1558 } // namespace cricket | 1552 } // namespace cricket |
| OLD | NEW |