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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 // If candidate filter only allows relay type of address, empty raddr to | 642 // If candidate filter only allows relay type of address, empty raddr to |
643 // avoid local address leakage. | 643 // avoid local address leakage. |
644 related_address = rtc::EmptySocketAddressWithFamily(stun_address.family()); | 644 related_address = rtc::EmptySocketAddressWithFamily(stun_address.family()); |
645 } | 645 } |
646 | 646 |
647 // For relayed candidate, Base is the candidate itself. | 647 // For relayed candidate, Base is the candidate itself. |
648 AddAddress(address, // Candidate address. | 648 AddAddress(address, // Candidate address. |
649 address, // Base address. | 649 address, // Base address. |
650 related_address, // Related address. | 650 related_address, // Related address. |
651 UDP_PROTOCOL_NAME, | 651 UDP_PROTOCOL_NAME, |
| 652 ProtoToString(server_address_.proto), // The first hop protocol. |
652 "", // TCP canddiate type, empty for turn candidates. | 653 "", // TCP canddiate type, empty for turn candidates. |
653 RELAY_PORT_TYPE, | 654 RELAY_PORT_TYPE, |
654 GetRelayPreference(server_address_.proto, server_address_.secure), | 655 GetRelayPreference(server_address_.proto, server_address_.secure), |
655 server_priority_, | 656 server_priority_, true); |
656 true); | |
657 } | 657 } |
658 | 658 |
659 void TurnPort::OnAllocateError() { | 659 void TurnPort::OnAllocateError() { |
660 // We will send SignalPortError asynchronously as this can be sent during | 660 // We will send SignalPortError asynchronously as this can be sent during |
661 // port initialization. This way it will not be blocking other port | 661 // port initialization. This way it will not be blocking other port |
662 // creation. | 662 // creation. |
663 thread()->Post(this, MSG_ERROR); | 663 thread()->Post(this, MSG_ERROR); |
664 } | 664 } |
665 | 665 |
666 void TurnPort::OnMessage(rtc::Message* message) { | 666 void TurnPort::OnMessage(rtc::Message* message) { |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 | 1336 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 |
1337 if (code == STUN_ERROR_STALE_NONCE) { | 1337 if (code == STUN_ERROR_STALE_NONCE) { |
1338 if (port_->UpdateNonce(response)) { | 1338 if (port_->UpdateNonce(response)) { |
1339 // Send channel bind request with fresh nonce. | 1339 // Send channel bind request with fresh nonce. |
1340 SendChannelBindRequest(0); | 1340 SendChannelBindRequest(0); |
1341 } | 1341 } |
1342 } | 1342 } |
1343 } | 1343 } |
1344 | 1344 |
1345 } // namespace cricket | 1345 } // namespace cricket |
OLD | NEW |