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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // TODO: set local preference value for TCP based candidates. | 203 // TODO: set local preference value for TCP based candidates. |
204 } | 204 } |
205 | 205 |
206 RelayPort::~RelayPort() { | 206 RelayPort::~RelayPort() { |
207 for (size_t i = 0; i < entries_.size(); ++i) | 207 for (size_t i = 0; i < entries_.size(); ++i) |
208 delete entries_[i]; | 208 delete entries_[i]; |
209 thread()->Clear(this); | 209 thread()->Clear(this); |
210 } | 210 } |
211 | 211 |
212 void RelayPort::AddServerAddress(const ProtocolAddress& addr) { | 212 void RelayPort::AddServerAddress(const ProtocolAddress& addr) { |
213 server_addr_.push_back(addr); | 213 // Since HTTP proxies usually only allow 443, |
| 214 // let's up the priority on PROTO_SSLTCP |
| 215 if (addr.proto == PROTO_SSLTCP && |
| 216 (proxy().type == rtc::PROXY_HTTPS || |
| 217 proxy().type == rtc::PROXY_UNKNOWN)) { |
| 218 server_addr_.push_front(addr); |
| 219 } else { |
| 220 server_addr_.push_back(addr); |
| 221 } |
214 } | 222 } |
215 | 223 |
216 void RelayPort::AddExternalAddress(const ProtocolAddress& addr) { | 224 void RelayPort::AddExternalAddress(const ProtocolAddress& addr) { |
217 std::string proto_name = ProtoToString(addr.proto); | 225 std::string proto_name = ProtoToString(addr.proto); |
218 for (std::vector<ProtocolAddress>::iterator it = external_addr_.begin(); | 226 for (std::vector<ProtocolAddress>::iterator it = external_addr_.begin(); |
219 it != external_addr_.end(); ++it) { | 227 it != external_addr_.end(); ++it) { |
220 if ((it->address == addr.address) && (it->proto == addr.proto)) { | 228 if ((it->address == addr.address) && (it->proto == addr.proto)) { |
221 LOG(INFO) << "Redundant relay address: " << proto_name | 229 LOG(INFO) << "Redundant relay address: " << proto_name |
222 << " @ " << addr.address.ToSensitiveString(); | 230 << " @ " << addr.address.ToSensitiveString(); |
223 return; | 231 return; |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout) | 839 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout) |
832 entry_->ScheduleKeepAlive(); | 840 entry_->ScheduleKeepAlive(); |
833 } | 841 } |
834 | 842 |
835 void AllocateRequest::OnTimeout() { | 843 void AllocateRequest::OnTimeout() { |
836 LOG(INFO) << "Allocate request timed out"; | 844 LOG(INFO) << "Allocate request timed out"; |
837 entry_->HandleConnectFailure(connection_->socket()); | 845 entry_->HandleConnectFailure(connection_->socket()); |
838 } | 846 } |
839 | 847 |
840 } // namespace cricket | 848 } // namespace cricket |
OLD | NEW |