| 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 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 " @ " << ra->address.ToSensitiveString(); | 484 " @ " << ra->address.ToSensitiveString(); |
| 485 | 485 |
| 486 rtc::AsyncPacketSocket* socket = NULL; | 486 rtc::AsyncPacketSocket* socket = NULL; |
| 487 | 487 |
| 488 if (ra->proto == PROTO_UDP) { | 488 if (ra->proto == PROTO_UDP) { |
| 489 // UDP sockets are simple. | 489 // UDP sockets are simple. |
| 490 socket = port_->socket_factory()->CreateUdpSocket( | 490 socket = port_->socket_factory()->CreateUdpSocket( |
| 491 rtc::SocketAddress(port_->ip(), 0), | 491 rtc::SocketAddress(port_->ip(), 0), |
| 492 port_->min_port(), port_->max_port()); | 492 port_->min_port(), port_->max_port()); |
| 493 } else if (ra->proto == PROTO_TCP || ra->proto == PROTO_SSLTCP) { | 493 } else if (ra->proto == PROTO_TCP || ra->proto == PROTO_SSLTCP) { |
| 494 int opts = (ra->proto == PROTO_SSLTCP) ? | 494 int opts = (ra->proto == PROTO_SSLTCP) |
| 495 rtc::PacketSocketFactory::OPT_SSLTCP : 0; | 495 ? rtc::PacketSocketFactory::OPT_TLS_FAKE |
| 496 : 0; |
| 496 socket = port_->socket_factory()->CreateClientTcpSocket( | 497 socket = port_->socket_factory()->CreateClientTcpSocket( |
| 497 rtc::SocketAddress(port_->ip(), 0), ra->address, | 498 rtc::SocketAddress(port_->ip(), 0), ra->address, |
| 498 port_->proxy(), port_->user_agent(), opts); | 499 port_->proxy(), port_->user_agent(), opts); |
| 499 } else { | 500 } else { |
| 500 LOG(LS_WARNING) << "Unknown protocol (" << ra->proto << ")"; | 501 LOG(LS_WARNING) << "Unknown protocol (" << ra->proto << ")"; |
| 501 } | 502 } |
| 502 | 503 |
| 503 if (!socket) { | 504 if (!socket) { |
| 504 LOG(LS_WARNING) << "Socket creation failed"; | 505 LOG(LS_WARNING) << "Socket creation failed"; |
| 505 } | 506 } |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout) | 838 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout) |
| 838 entry_->ScheduleKeepAlive(); | 839 entry_->ScheduleKeepAlive(); |
| 839 } | 840 } |
| 840 | 841 |
| 841 void AllocateRequest::OnTimeout() { | 842 void AllocateRequest::OnTimeout() { |
| 842 LOG(INFO) << "Allocate request timed out"; | 843 LOG(INFO) << "Allocate request timed out"; |
| 843 entry_->HandleConnectFailure(connection_->socket()); | 844 entry_->HandleConnectFailure(connection_->socket()); |
| 844 } | 845 } |
| 845 | 846 |
| 846 } // namespace cricket | 847 } // namespace cricket |
| OLD | NEW |