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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 | 264 |
265 void Transport::CallChannels(TransportChannelFunc func) { | 265 void Transport::CallChannels(TransportChannelFunc func) { |
266 for (const auto& kv : channels_) { | 266 for (const auto& kv : channels_) { |
267 (kv.second->*func)(); | 267 (kv.second->*func)(); |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
271 bool Transport::VerifyCandidate(const Candidate& cand, std::string* error) { | 271 bool Transport::VerifyCandidate(const Candidate& cand, std::string* error) { |
272 // No address zero. | 272 // No address zero. |
273 if (cand.address().IsNil() || cand.address().IsAny()) { | 273 if (cand.address().IsNil() || cand.address().IsAnyIP()) { |
274 *error = "candidate has address of zero"; | 274 *error = "candidate has address of zero"; |
275 return false; | 275 return false; |
276 } | 276 } |
277 | 277 |
278 // Disallow all ports below 1024, except for 80 and 443 on public addresses. | 278 // Disallow all ports below 1024, except for 80 and 443 on public addresses. |
279 int port = cand.address().port(); | 279 int port = cand.address().port(); |
280 if (cand.protocol() == TCP_PROTOCOL_NAME && | 280 if (cand.protocol() == TCP_PROTOCOL_NAME && |
281 (cand.tcptype() == TCPTYPE_ACTIVE_STR || port == 0)) { | 281 (cand.tcptype() == TCPTYPE_ACTIVE_STR || port == 0)) { |
282 // Expected for active-only candidates per | 282 // Expected for active-only candidates per |
283 // http://tools.ietf.org/html/rfc6544#section-4.5 so no error. | 283 // http://tools.ietf.org/html/rfc6544#section-4.5 so no error. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // negotiation happens. | 384 // negotiation happens. |
385 for (const auto& kv : channels_) { | 385 for (const auto& kv : channels_) { |
386 if (!ApplyNegotiatedTransportDescription(kv.second, error_desc)) { | 386 if (!ApplyNegotiatedTransportDescription(kv.second, error_desc)) { |
387 return false; | 387 return false; |
388 } | 388 } |
389 } | 389 } |
390 return true; | 390 return true; |
391 } | 391 } |
392 | 392 |
393 } // namespace cricket | 393 } // namespace cricket |
OLD | NEW |