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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 435 } |
436 socket_ = NULL; | 436 socket_ = NULL; |
437 | 437 |
438 PrepareAddress(); | 438 PrepareAddress(); |
439 ++allocate_mismatch_retries_; | 439 ++allocate_mismatch_retries_; |
440 } | 440 } |
441 | 441 |
442 Connection* TurnPort::CreateConnection(const Candidate& address, | 442 Connection* TurnPort::CreateConnection(const Candidate& address, |
443 CandidateOrigin origin) { | 443 CandidateOrigin origin) { |
444 // TURN-UDP can only connect to UDP candidates. | 444 // TURN-UDP can only connect to UDP candidates. |
445 if (address.protocol() != UDP_PROTOCOL_NAME) { | 445 if (!SupportsProtocol(address.protocol())) { |
446 return NULL; | 446 return NULL; |
447 } | 447 } |
448 | 448 |
449 if (!IsCompatibleAddress(address.address())) { | 449 if (!IsCompatibleAddress(address.address())) { |
450 return NULL; | 450 return NULL; |
451 } | 451 } |
452 | 452 |
453 if (state_ == STATE_DISCONNECTED) { | 453 if (state_ == STATE_DISCONNECTED) { |
454 return NULL; | 454 return NULL; |
455 } | 455 } |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 } else { | 1483 } else { |
1484 state_ = STATE_UNBOUND; | 1484 state_ = STATE_UNBOUND; |
1485 port_->DestroyConnection(ext_addr_); | 1485 port_->DestroyConnection(ext_addr_); |
1486 } | 1486 } |
1487 } | 1487 } |
1488 void TurnEntry::OnChannelBindTimeout() { | 1488 void TurnEntry::OnChannelBindTimeout() { |
1489 state_ = STATE_UNBOUND; | 1489 state_ = STATE_UNBOUND; |
1490 port_->DestroyConnection(ext_addr_); | 1490 port_->DestroyConnection(ext_addr_); |
1491 } | 1491 } |
1492 } // namespace cricket | 1492 } // namespace cricket |
OLD | NEW |